本文整理汇总了PHP中vc_automapper函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_automapper函数的具体用法?PHP vc_automapper怎么用?PHP vc_automapper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_automapper函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setTabs
/**
*
*/
public function setTabs()
{
$this->tabs = array();
if ($this->showConfigurationTabs()) {
$this->tabs['vc-general'] = __('General Settings', 'js_composer');
if (!vc_is_as_theme() && apply_filters('vc_settings_page_show_design_tabs', true)) {
$this->tabs['vc-color'] = __('Design Options', 'js_composer');
$this->tabs['vc-custom_css'] = __('Custom CSS', 'js_composer');
}
}
if (!vc_is_network_plugin() || vc_is_network_plugin() && is_network_admin()) {
if (!vc_is_updater_disabled()) {
$this->tabs['vc-updater'] = __('Product License', 'js_composer');
}
}
// TODO: may allow to disable automapper
if (!is_network_admin() && !vc_automapper_is_disabled()) {
$this->tabs['vc-automapper'] = vc_automapper()->title();
}
}
示例2: init
/**
* Callback function for WP init action hook. Sets Vc mode and loads required objects.
*
* @since 4.2
* @access public
*
* @return void
*/
public function init()
{
do_action('vc_before_init');
$this->setMode();
do_action('vc_after_set_mode');
/**
* Set version of VC if required.
*/
$this->setVersion();
// Load required
!vc_is_updater_disabled() && vc_updater()->init();
/**
* Init default hooks and options to load.
*/
$this->vc()->init();
/**
* if is admin and not front end editor.
*/
is_admin() && !vc_is_frontend_editor() && $this->asAdmin();
/**
* if frontend editor is enabled init editor.
*/
vc_enabled_frontend() && vc_frontend_editor()->init();
do_action('vc_before_mapping');
// VC ACTION
// Include default shortcodes.
$this->mapper()->init();
//execute all required
do_action('vc_after_mapping');
// VC ACTION
// Load && Map shortcodes from Automapper.
vc_automapper()->map();
if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-updater-tab')->get()) {
vc_license()->setupReminder();
}
do_action('vc_after_init');
}
示例3: output
//.........这里部分代码省略.........
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');
?>
<input type="hidden" name="vc_action" value="" id="vc-settings-<?php
echo $tab;
?>
-action"/>
<a href="#" class="button vc-restore-button"
id="vc-settings-custom-css-reset-data"><?php
_e('Remove all saved', LANGUAGE_ZONE);
?>
</a>
</form>
<?php
} 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)) {
示例4: vc_automapper_is_disabled
/**
* @since 4.2
* @return bool
*/
function vc_automapper_is_disabled()
{
return vc_automapper()->disabled();
}
示例5: setUpPlugin
public function setUpPlugin()
{
if (is_plugin_active_for_network('js_composer/js_composer.php') || is_network_only_plugin('js_composer/js_composer.php')) {
$this->composer->setAsNetworkPlugin(true);
}
global $current_user;
get_currentuserinfo();
/** @var $settings - get use group access rules */
$settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
parent::setUpPlugin();
$show = true;
foreach ($current_user->roles as $role) {
if (isset($settings[$role]['show']) && $settings[$role]['show'] === 'no') {
$show = false;
break;
}
}
if ($show) {
$this->composer->addAction('edit_post', 'saveMetaBoxes');
$this->composer->addAction('wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_get_convert_elements_backend_html', 'Convert2NewVersionJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_get_row_element_backend_html', 'elementRowBackendHtmlJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_single_image_src', 'singleImageSrcJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_gallery_html', 'galleryHTMLJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_get_loop_suggestion', 'getLoopSuggestionJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_remove_settings_notification_element_css_class', 'removeSettingsNotificationJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_image_url', 'getImageUrlByIdJavascript_callback');
/*
* Create edit form html
* @deprecated
*/
$this->composer->addAction('wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_get_edit_form', 'getEditFormJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_load_inline_template', 'loadInlineTemplateJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_load_template_shortcodes', 'loadTemplateShortcodesJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_get_loop_settings', 'getLoopSettingsJavascript_callback');
$this->composer->addAction('wp_ajax_wpb_activate_license', 'activateLicense');
$this->composer->addAction('wp_ajax_wpb_deactivate_license', 'deactivateLicense');
$this->composer->inlineEditor()->addAction('wp_ajax_vc_load_shortcode', 'loadShortcodes');
$this->composer->inlineEditor()->addAction('wp_ajax_vc_show_edit_form', 'renderEditForm');
$this->composer->inlineEditor()->addAction('wp_ajax_vc_update_content', 'savePost');
$this->composer->inlineEditor()->addAction('wp_ajax_vc_inline_template', 'renderTemplate');
$this->composer->inlineEditor()->addAction('wp_ajax_vc_show_inline_edit_form', 'buildInlineEditForm');
$this->addAction('admin_init', 'jsComposerEditPage', 5);
$this->composer->inlineEditor()->addFilter('page_row_actions', 'renderRowAction');
$this->composer->inlineEditor()->addFilter('post_row_actions', 'renderRowAction');
}
vc_automapper()->addAction('wp_ajax_vc_automapper', 'goAction');
if (vc_is_inline()) {
$this->composer->inlineEditor()->addFilter('vc_single_param_edit', 'changeEditFormFieldParams');
$this->composer->inlineEditor()->addFilter('vc_edit_form_class', 'changeEditFormParams');
}
$this->composer->addAction('admin_init', 'renderInlineEditor');
// Add specific CSS class by filter
$this->addFilter('body_class', 'jsComposerBodyClass');
$this->addFilter('get_media_item_args', 'jsForceSend');
$this->addAction('admin_init', 'composerRedirect');
$this->addAction('admin_init', 'registerCss');
$this->addAction('admin_init', 'registerJavascript');
if ($this->composer->isNetworkPlugin() && is_network_admin()) {
$this->addAction('network_admin_menu', 'composerSettings');
}
$this->addAction('admin_menu', 'composerSettings');
$this->addAction('admin_print_scripts-post.php', 'editScreen_js');
$this->addAction('admin_print_scripts-post-new.php', 'editScreen_js');
// Upgrade message in plugins list.
if ($this->composer->updaterDisabled()) {
return $this;
}
$plugin_file_name = 'js_composer/js_composer.php';
new WpbAutoUpdate(WPB_VC_VERSION, 'http://wpbakery.com/version/?' . time(), $plugin_file_name);
$this->addAction('in_plugin_update_message-' . $plugin_file_name, 'addUpgradeMessageLink');
}
示例6: init
/**
* Callback function for WP init action hook. Sets Vc mode and loads required objects.
*
* @since 4.2
* @access public
* @return void
*/
public function init()
{
do_action('vc_before_init');
$this->setMode();
/**
* Set version of VC if required.
*/
$this->setVersion();
// Load required
!vc_is_updater_disabled() && vc_updater()->init();
/**
* Init default hooks and options to load.
*/
$this->vc()->init();
/**
* if is admin and not front end editor.
*/
is_admin() && !vc_is_frontend_editor() && $this->asAdmin();
/**
* if frontend editor is enabled init editor.
*/
vc_enabled_frontend() && vc_frontend_editor()->init();
// Load Automapper
vc_automapper()->addAjaxActions();
do_action('vc_before_mapping');
// VC ACTION
// Include default shortcodes.
$this->mapper()->init();
//execute all required
do_action('vc_after_mapping');
// VC ACTION
// Load && Map shortcodes from Automapper.
vc_automapper()->map();
do_action('vc_after_init');
}
示例7: vc_automapper_init
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init()
{
vc_automapper()->build();
}
示例8: apply_filters
<form action="options.php" method="post" id="vc_settings-automapper"
class="vc_settings-tab-content vc_settings-tab-content-active"<?php
echo apply_filters('vc_setting-tab-form-automapper', '');
?>
>
<?php
vc_automapper()->renderHtml();
?>
</form>
示例9: vc_automapper_init
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init()
{
vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-automapper-tab')->get() && vc_automapper()->build();
}
示例10: vc_atm_map
function vc_atm_map()
{
vc_automapper()->map();
}
示例11: vc_automapper_init
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init()
{
if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-automapper-tab')->get()) {
vc_automapper()->addAjaxActions();
}
}
示例12: vc_automapper_init
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init()
{
current_user_can('manage_options') && vc_automapper()->build();
}
示例13: nm_vc_remove_admin_menus
}
}
/* Remove admin menus */
if (!$nm_vcomp_stock) {
function nm_vc_remove_admin_menus()
{
remove_submenu_page('vc-general', 'vc-automapper');
remove_submenu_page('vc-general', 'edit.php?post_type=vc_grid_item');
//remove_submenu_page( 'vc-general', 'vc-welcome' ); // Note: Don't disable, this page is displayed after plugin activation (blank page with permission message displaying otherwise)
}
add_action('admin_menu', 'nm_vc_remove_admin_menus', 1000);
}
// Disable shortcode automapper feature
if (!$nm_vcomp_stock) {
if (function_exists('vc_automapper')) {
vc_automapper()->setDisabled(true);
}
}
/* Remove "vc_teaser" metabox */
function nm_vc_remove_teaser_metabox()
{
remove_meta_box('vc_teaser', '', 'side');
}
add_action('admin_head', 'nm_vc_remove_teaser_metabox');
// Set default editor post types (will not be used if the "content_types" VC setting is already saved - see fix below)
$post_types = array('page');
vc_set_default_editor_post_types($post_types);
// Default editor post types: Un-comment and refresh WP admin to save/reset the "content_types" VC option
// NOTE: Remember to comment-out after page refresh!
//vc_settings()->set( 'content_types', $post_types );
}