本文整理汇总了PHP中vc_license函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_license函数的具体用法?PHP vc_license怎么用?PHP vc_license使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_license函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printScriptsMessages
/**
* Enqueue required javascript libraries and css files.
*
* This method also setups reminder about license activation.
*
* @since 4.2
* @access public
*/
public function printScriptsMessages() {
if ( in_array( get_post_type(), vc_editor_post_types() )) {
vc_license()->setupReminder();
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
wp_enqueue_style( 'farbtastic' );
wp_enqueue_style( 'ui-custom-theme' );
wp_enqueue_style( 'isotope-css' );
wp_enqueue_style( 'animate-css' );
wp_enqueue_style( 'js_composer' );
wp_enqueue_style( 'wpb_jscomposer_autosuggest' );
WPBakeryShortCode_Settings::enqueueCss();
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-ui-sortable' );
wp_enqueue_script( 'jquery-ui-droppable' );
wp_enqueue_script( 'jquery-ui-draggable' );
wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-autocomplete' );
wp_enqueue_script( 'farbtastic' );
//MMM wp_enqueue_script('bootstrap-js');
wp_enqueue_script( 'isotope' );
wp_enqueue_script( 'wpb_bootstrap_modals_js' );
wp_enqueue_script( 'wpb_scrollTo_js' );
wp_enqueue_script( 'wpb_php_js' );
// js composer js app {{
// wpb_js_composer_js_sortable
wp_enqueue_script( 'wpb_js_composer_js_sortable' );
wp_enqueue_script( 'wpb_json-js' );
wp_enqueue_script( 'wpb_js_composer_js_tools' );
wp_enqueue_script( 'wpb_js_composer_js_storage' );
wp_enqueue_script( 'wpb_js_composer_js_models' );
wp_enqueue_script( 'wpb_js_composer_js_view' );
wp_enqueue_script( 'wpb_js_composer_js_custom_views' );
wp_enqueue_script( 'wpb_js_composer_js_backbone' );
wp_enqueue_script( 'wpb_jscomposer_composer_js' );
wp_enqueue_script( 'wpb_jscomposer_shortcode_js' );
wp_enqueue_script( 'wpb_jscomposer_modal_js' );
wp_enqueue_script( 'wpb_jscomposer_templates_js' );
wp_enqueue_script( 'wpb_jscomposer_stage_js' );
wp_enqueue_script( 'wpb_jscomposer_layout_js' );
wp_enqueue_script( 'wpb_jscomposer_row_js' );
wp_enqueue_script( 'wpb_jscomposer_settings_js' );
wp_enqueue_script( 'wpb_jscomposer_media_editor_js' );
wp_enqueue_script( 'wpb_jscomposer_autosuggest_js' );
// }}
wp_enqueue_script( 'wpb_js_composer_js' );
WPBakeryShortCode_Settings::enqueueJs();
}
}
示例2: upgradeFilterFromEnvato
/**
* Downloads new VC from Envato marketplace and unzips into temporary directory.
*
* @param $reply
* @param $package
* @param $updater
* @return mixed|string|WP_Error
*/
public function upgradeFilterFromEnvato($reply, $package, $updater)
{
global $wp_filesystem;
if (isset($updater->skin->plugin) && $updater->skin->plugin === vc_plugin_name() || isset($updater->skin->plugin_info) && $updater->skin->plugin_info['Name'] === $this->title) {
$updater->strings['download_envato'] = __('Downloading package from envato market...', LANGUAGE_ZONE);
$updater->skin->feedback('download_envato');
$package_filename = 'js_composer.zip';
$res = $updater->fs_connect(array(WP_CONTENT_DIR));
if (!$res) {
return new WP_Error('no_credentials', __("Error! Can't connect to filesystem", LANGUAGE_ZONE));
}
$username = vc_settings()->get('envato_username');
$api_key = vc_settings()->get('envato_api_key');
$purchase_code = vc_settings()->get('js_composer_purchase_code');
if (!vc_license()->isActivated() || empty($username) || empty($api_key) || empty($purchase_code)) {
return new WP_Error('no_credentials', __('To receive automatic updates license activation is required. Please visit <a href="' . admin_url('options-general.php?page=vc_settings&tab=updater') . '' . '" target="_blank">Settings</a> to activate your Visual Composer.', LANGUAGE_ZONE));
}
$json = wp_remote_get($this->envatoDownloadPurchaseUrl($username, $api_key, $purchase_code));
$result = json_decode($json['body'], true);
if (!isset($result['download-purchase']['download_url'])) {
return new WP_Error('no_credentials', __('Error! Envato API error' . (isset($result['error']) ? ': ' . $result['error'] : '.'), LANGUAGE_ZONE));
}
$result['download-purchase']['download_url'];
$download_file = download_url($result['download-purchase']['download_url']);
if (is_wp_error($download_file)) {
return $download_file;
}
$upgrade_folder = $wp_filesystem->wp_content_dir() . 'uploads/js_composer_envato_package';
if (is_dir($upgrade_folder)) {
$wp_filesystem->delete($upgrade_folder);
}
$result = unzip_file($download_file, $upgrade_folder);
if ($result && is_file($upgrade_folder . '/' . $package_filename)) {
return $upgrade_folder . '/' . $package_filename;
}
return new WP_Error('no_credentials', __('Error on unzipping package', LANGUAGE_ZONE));
}
return $reply;
}
示例3: asAdmin
/**
* Load required logic for operating in Wp Admin dashboard.
*
* @since 4.2
* @access protected
*
* @return void
*/
protected function asAdmin()
{
vc_license()->init();
vc_backend_editor()->addHooksSettings();
}
示例4: disableIfActivated
/**
* @deprecated 4.8 Remove after 2015-12-01
*
* @return string
*/
public function disableIfActivated()
{
// _deprecated_function( '\Vc_Settings::disableIfActivated', '4.8 (will be removed in 4.11)' );
if (!isset($this->deactivate_license)) {
$this->deactivate_license = vc_license()->deactivation();
}
return empty($this->deactivate_license) ? '' : ' disabled="true" class="vc_updater-passive"';
}
示例5: printScriptsMessages
/**
* Enqueue required javascript libraries and css files.
*
* This method also setups reminder about license activation.
*
* @since 4.2
* @access public
*/
public function printScriptsMessages()
{
if (!vc_is_frontend_editor() && $this->isValidPostType()) {
if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-updater-tab')->get()) {
vc_license()->setupReminder();
}
$this->enqueueEditorScripts();
}
}
示例6: addUpgradeMessageLink
/**
* Shows message on Wp plugins page with a link for updating from envato.
*/
public function addUpgradeMessageLink()
{
$is_activated = vc_license()->isActivated();
if (!$is_activated) {
$url = esc_url(vc_is_network_plugin() ? network_admin_url('admin.php?page=vc-updater') : admin_url('admin.php?page=vc-updater'));
$redirect = sprintf('<a href="%s" target="_blank">%s</a>', $url, __('settings', 'js_composer'));
echo sprintf(' ' . __('To receive automatic updates license activation is required. Please visit %s to activate your Visual Composer.', 'js_composer'), $redirect) . sprintf(' <a href="http://go.wpbakery.com/faq-update-in-theme" target="_blank">%s</a>', __('Got Visual Composer in theme?', 'js_composer'));
}
}
示例7: output
//.........这里部分代码省略.........
} elseif ($tab == 'automapper') {
?>
<form action="options.php" method="post" id="vc-settings-<?php
echo $tab;
?>
"
class="vc-settings-tab-content<?php
echo $this->active_tab == $tab ? ' vc-settings-tab-content-active' : '';
?>
"<?php
echo apply_filters('vc_setting-tab-form-' . $tab, '');
?>
>
<?php
vc_automapper()->renderHtml();
?>
</form>
<?php
} else {
?>
<?php
$css = $tab == 'color' && $use_custom ? ' color_enabled' : '';
?>
<form action="options.php" method="post" id="vc-settings-<?php
echo $tab;
?>
"
class="vc-settings-tab-content<?php
echo ($this->active_tab == $tab ? ' vc-settings-tab-content-active' : '') . $css;
?>
"<?php
echo apply_filters('vc_setting-tab-form-' . $tab, '');
?>
>
<?php
settings_fields($this->option_group . '_' . $tab);
?>
<?php
do_settings_sections($this->page . '_' . $tab);
?>
<?php
wp_nonce_field('wpb_js_settings_save_action', 'wpb_js_nonce_field');
?>
<?php
$submit_button_attributes = array();
$license_activation_key = vc_license()->deactivation();
if ($tab === 'updater' && !empty($license_activation_key)) {
$submit_button_attributes['disabled'] = 'true';
}
?>
<?php
submit_button(__('Save Changes', LANGUAGE_ZONE), 'primary', 'submit', true, $submit_button_attributes);
?>
<input type="hidden" name="vc_action" value="" id="vc-settings-<?php
echo $tab;
?>
-action"/>
<?php
if ($tab == 'color') {
?>
<a href="#" class="button vc-restore-button"
id="vc-settings-color-restore-default"><?php
_e('Restore to defaults', LANGUAGE_ZONE);
?>
</a>
<?php
}
?>
<?php
if ($tab === 'updater') {
?>
<input type="hidden" id="vc-settings-license-status" name="vc_license_status"
value="<?php
echo empty($license_activation_key) ? 'not_activated' : 'activated';
?>
"/>
<a href="#" class="button vc-activate-license-button"
id="vc-settings-activate-license"><?php
empty($license_activation_key) ? _e('Activate license', LANGUAGE_ZONE) : _e('Deactivate license', LANGUAGE_ZONE);
?>
</a>
<span class="vc-updater-spinner-wrapper" style="display: none;" id="vc-updater-spinner"><img
src="<?php
echo get_site_url();
?>
/wp-admin/images/wpspin_light.gif"/></span>
<?php
}
?>
</form>
<?php
}
?>
<?php
}
?>
</div>
<?php
}
示例8: asAdmin
/**
* Load required logic for operating in Wp Admin dashboard.
*
* @since 4.2
* @access protected
* @return void
*/
protected function asAdmin()
{
// License management and activation/deactivation methods.
vc_license()->addAjaxHooks();
// Settings page. Adds menu page in admin panel.
vc_settings()->addMenuPageHooks();
// Load backend editor hooks
vc_backend_editor()->addHooksSettings();
// If auto updater is enabled initialize updating notifications service.
}
示例9: printScriptsMessages
/**
* Enqueue required javascript libraries and css files.
*
* This method also setups reminder about license activation.
*
* @since 4.2
* @access public
*/
public function printScriptsMessages()
{
if ($this->isValidPostType()) {
vc_license()->setupReminder();
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
wp_enqueue_style('farbtastic');
wp_enqueue_style('ui-custom-theme');
wp_enqueue_style('isotope-css');
wp_enqueue_style('animate-css');
wp_enqueue_style('font-awesome');
wp_enqueue_style('js_composer');
wp_enqueue_style('wpb_jscomposer_autosuggest');
wp_enqueue_style('js_composer_settings', vc_asset_url('css/js_composer_settings.css'), array(), WPB_VC_VERSION, false);
WPBakeryShortCodeFishBones::enqueueCss();
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-droppable');
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_script('jquery-ui-autocomplete');
wp_enqueue_script('jquery-ui-resizable');
wp_enqueue_script('farbtastic');
wp_enqueue_script('isotope');
$bootstrap_version = '3.0.2';
wp_enqueue_script('vc_bootstrap_js_1', vc_asset_url('lib/bower/bootstrap3/js/modal.js'), array('jquery'), $bootstrap_version, true);
wp_enqueue_script('vc_bootstrap_js_2', vc_asset_url('lib/bower/bootstrap3/js/dropdown.js'), array('jquery'), $bootstrap_version, true);
wp_enqueue_script('vc_bootstrap_js_11', vc_asset_url('lib/bower/bootstrap3/js/transition.js'), array('jquery'), $bootstrap_version, true);
wp_enqueue_script('wpb_scrollTo_js');
wp_enqueue_script('wpb_php_js');
wp_enqueue_script('wpb_js_composer_js_sortable');
wp_enqueue_script('wpb_json-js');
wp_enqueue_script('ace-editor');
wp_enqueue_script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
// Google Web Font CDN
wp_enqueue_script('wpb_js_composer_js_tools');
wp_enqueue_script('wpb_js_composer_js_storage');
wp_enqueue_script('wpb_js_composer_js_models');
wp_enqueue_script('wpb_js_composer_js_view');
wp_enqueue_script('wpb_js_composer_js_custom_views');
/**
* Enqueue deprecated
* @since 4.4 removed
*/
wp_enqueue_script('wpb_js_composer_js_backbone');
wp_enqueue_script('wpb_jscomposer_composer_js');
wp_enqueue_script('wpb_jscomposer_shortcode_js');
wp_enqueue_script('wpb_jscomposer_modal_js');
wp_enqueue_script('wpb_jscomposer_templates_js');
wp_enqueue_script('wpb_jscomposer_stage_js');
wp_enqueue_script('wpb_jscomposer_layout_js');
wp_enqueue_script('wpb_jscomposer_row_js');
wp_enqueue_script('wpb_jscomposer_settings_js');
wp_enqueue_script('wpb_jscomposer_media_editor_js');
wp_enqueue_script('wpb_jscomposer_autosuggest_js');
wp_enqueue_script('wpb_js_composer_js');
/**
* @since 4.4
*/
do_action('vc_backend_editor_enqueue_js_css');
WPBakeryShortCodeFishBones::enqueueJs();
}
}
示例10: addUpgradeMessageLink
/**
* Shows message on Wp plugins page with a link for updating from envato.
*/
public function addUpgradeMessageLink()
{
$username = vc_settings()->get('envato_username');
$api_key = vc_settings()->get('envato_api_key');
$purchase_code = vc_license()->getLicenseKey();
echo '<style type="text/css" media="all">tr#wpbakery-visual-composer + tr.plugin-update-tr a.thickbox + em { display: none; }</style>';
if (empty($username) || empty($api_key) || empty($purchase_code)) {
echo ' <a href="' . $this->url . '">' . __('Download new version from CodeCanyon.', 'js_composer') . '</a>';
} else {
// update.php?action=upgrade-plugin&plugin=testimonials-widget%2Ftestimonials-widget.php&_wpnonce=6178d48b6e
echo '<a href="' . wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . vc_plugin_name()), 'upgrade-plugin_' . vc_plugin_name()) . '">' . __('Update Visual Composer now.', 'js_composer') . '</a>';
}
}
示例11: __
<a href="#" class="button vc_restore-button" id="vc_settings-color-restore-default">
<?php
echo __('Restore Default', 'js_composer');
?>
</a>
<?php
}
?>
<?php
if ('updater' === $tab) {
?>
<div class="vc_settings-activation-deactivation">
<?php
if (vc_license()->isActivated()) {
?>
<p>
<?php
echo __('You have activated Visual Composer version which allows you to access all the customer benefits. Thank you for choosing Visual Composer as your page builder. If you do not wish to use Visual Composer on this WordPress site you can deactivate your license below.', 'js_composer');
?>
</p>
<br/>
<p>
<button
class="button button-primary button-hero button-updater"
data-vc-action="deactivation"
type="button"
示例12: printScriptsMessages
/**
* Enqueue required javascript libraries and css files.
*
* This method also setups reminder about license activation.
*
* @since 4.2
* @access public
*/
public function printScriptsMessages()
{
if (in_array(get_post_type(), vc_editor_post_types())) {
vc_license()->setupReminder();
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
wp_enqueue_style('farbtastic');
wp_enqueue_style('ui-custom-theme');
wp_enqueue_style('isotope-css');
wp_enqueue_style('animate-css');
wp_enqueue_style('js_composer');
wp_enqueue_style('wpb_jscomposer_autosuggest');
WPBakeryShortCode_Settings::enqueueCss();
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-droppable');
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_script('jquery-ui-autocomplete');
wp_enqueue_script('farbtastic');
wp_enqueue_script('isotope');
wp_enqueue_script('vc_bootstrap_js', vc_asset_url('lib/bootstrap3/dist/js/bootstrap.min.js'), array('jquery'), '3.0.2', true);
wp_enqueue_script('wpb_scrollTo_js');
wp_enqueue_script('wpb_php_js');
wp_enqueue_script('wpb_js_composer_js_sortable');
wp_enqueue_script('wpb_json-js');
wp_enqueue_style('js_composer_settings', vc_asset_url('css/js_composer_settings.css'), false, WPB_VC_VERSION, false);
wp_enqueue_script('ace-editor');
wp_enqueue_script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
// Google Web Font CDN
wp_enqueue_script('wpb_js_composer_js_tools');
wp_enqueue_script('wpb_js_composer_js_storage');
wp_enqueue_script('wpb_js_composer_js_models');
wp_enqueue_script('wpb_js_composer_js_view');
wp_enqueue_script('wpb_js_composer_js_custom_views');
/**
* Enqueue deprecated
*/
wp_enqueue_script('vc_js_composer_js_backend_deprecated', vc_asset_url('js/backend/deprecated.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true);
wp_enqueue_script('wpb_js_composer_js_backbone');
wp_enqueue_script('wpb_jscomposer_composer_js');
wp_enqueue_script('wpb_jscomposer_shortcode_js');
wp_enqueue_script('wpb_jscomposer_modal_js');
wp_enqueue_script('wpb_jscomposer_templates_js');
wp_enqueue_script('wpb_jscomposer_stage_js');
wp_enqueue_script('wpb_jscomposer_layout_js');
wp_enqueue_script('wpb_jscomposer_row_js');
wp_enqueue_script('wpb_jscomposer_settings_js');
wp_enqueue_script('wpb_jscomposer_media_editor_js');
wp_enqueue_script('wpb_jscomposer_autosuggest_js');
// }}
wp_enqueue_script('wpb_js_composer_js');
WPBakeryShortCode_Settings::enqueueJs();
}
}
示例13: _e
<p class="description indicator-hint"><?php
_e('Guide tours are shown in VC editors to help you to start working with editors. Yo can see them again by clicking button above.', 'js_composer');
?>
</p>
</td>
</tr>
</table>
<?php
}
?>
<?php
$submit_button_attributes = array();
$submit_button_attributes = apply_filters('vc_settings-tab-submit-button-attributes', $submit_button_attributes, $tab);
$submit_button_attributes = apply_filters('vc_settings-tab-submit-button-attributes-' . $tab, $submit_button_attributes, $tab);
$license_activation_key = vc_license()->deactivation();
if ($tab === 'updater' && !empty($license_activation_key)) {
$submit_button_attributes['disabled'] = 'true';
}
?>
<?php
if ($tab !== 'updater') {
?>
<?php
submit_button(__('Save Changes', 'js_composer'), 'primary', 'submit_btn', true, $submit_button_attributes);
?>
<?php
}
?>
<input type="hidden" name="vc_action" value="vc_action-<?php
echo $tab;
示例14: activate
/**
* Old activation process
*
* @deprecated 4.8 Remove after 2015-12-01
*/
public function activate()
{
// _deprecated_function( '\Vc_License::active', '4.8 (will be removed in 4.11)' );
vc_user_access()->checkAdminNonce()->validateDie()->wpAny('manage_options')->validateDie()->part('settings')->can('vc-updater-tab')->validateDie();
$params = array();
$params['username'] = vc_post_param('username');
$params['version'] = WPB_VC_VERSION;
$params['key'] = vc_post_param('key');
$params['api_key'] = vc_post_param('api_key');
$params['url'] = get_site_url();
$params['ip'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '';
$params['dkey'] = vc_random_string(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 (true === (bool) $result->result || 401 === (int) $result->code && isset($result->deactivation_key)) {
$this->setDeactivation(isset($result->code) && (int) $result->code === 401 ? $result->deactivation_key : $params['dkey']);
vc_settings()->set('envato_username', $params['username']);
vc_settings()->set('envato_api_key', $params['api_key']);
vc_license()->setLicenseKey($params['key']);
echo json_encode(array('result' => true));
die;
}
echo $response['body'];
die;
}
示例15: x_visual_composer_hide_update_notice
function x_visual_composer_hide_update_notice()
{
remove_action('admin_notices', array(vc_license(), 'adminNoticeLicenseActivation'));
}