本文整理汇总了PHP中WPBakeryVisualComposerSettings::getFieldPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP WPBakeryVisualComposerSettings::getFieldPrefix方法的具体用法?PHP WPBakeryVisualComposerSettings::getFieldPrefix怎么用?PHP WPBakeryVisualComposerSettings::getFieldPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPBakeryVisualComposerSettings
的用法示例。
在下文中一共展示了WPBakeryVisualComposerSettings::getFieldPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activateLicense
public function activateLicense()
{
$params = array();
$params['username'] = $this->post('username');
$params['key'] = $this->post('key');
$params['api_key'] = $this->post('api_key');
$params['url'] = get_site_url();
$params['ip'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '';
$params['dkey'] = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
$string = 'activatelicense?';
$request_url = self::getWpbControlUrl(array($string, http_build_query($params, '', '&')));
$response = wp_remote_get($request_url, array('timeout' => 300));
if (is_wp_error($response)) {
echo json_encode(array('result' => false));
die;
}
$result = json_decode($response['body']);
if (!is_object($result)) {
echo json_encode(array('result' => false));
die;
}
if ((bool) $result->result === true || (int) $result->code === 401 && isset($result->deactivation_key)) {
$this->setDeactivationLicense(isset($result->code) && (int) $result->code === 401 ? $result->deactivation_key : $params['dkey']);
update_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'envato_username', $params['username']);
update_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'envato_api_key', $params['api_key']);
update_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'js_composer_purchase_code', $params['key']);
echo json_encode(array('result' => true));
die;
}
echo $response['body'];
die;
}
示例2: addThemeBodyClass
/**
* Adds themes css class to body tag.
* @param $classes
* @return array
*/
public function addThemeBodyClass($classes)
{
if (!class_exists('WPBakeryVisualComposerSettings')) {
return $classes;
}
$theme = ($theme = get_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'themes')) ? $theme : '';
if (!empty($theme)) {
$classes[] = 'vct_' . preg_replace('/\\.css$/', '', $theme);
}
return $classes;
}