本文整理汇总了PHP中vc_backend_editor函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_backend_editor函数的具体用法?PHP vc_backend_editor怎么用?PHP vc_backend_editor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_backend_editor函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: save
public function save() {
$template_name = vc_post_param( 'template_name' );
$template = vc_post_param( 'template' );
if ( ! isset( $template_name ) || $template_name == "" || ! isset( $template ) || $template == "" ) {
echo 'Error: TPL-01';
die();
}
$template_arr = array( "name" => stripslashes( $template_name ), "template" => stripslashes( $template ) );
$option_name = 'wpb_js_templates';
$saved_templates = get_option( $option_name );
$template_id = sanitize_title( $template_name ) . "_" . rand();
if ( $saved_templates == false ) {
$deprecated = '';
$autoload = 'no';
//
$new_template = array();
$new_template[$template_id] = $template_arr;
//
add_option( $option_name, $new_template, $deprecated, $autoload );
} else {
$saved_templates[$template_id] = $template_arr;
update_option( $option_name, $saved_templates );
}
echo vc_backend_editor()->getLayout()->getNavBar()->getTemplateMenu( true );
//delete_option('wpb_js_templates');
die();
}
开发者ID:verbazend,项目名称:AWFA,代码行数:34,代码来源:class-vc-templates-editor.php
示例2: vc_set_default_content_for_post_type
/**
* Set default content by post type in editor.
*
* Data for post type templates stored in settings.
*
* @param $post_content
* @param $post
* @since 4.12
*
* @return null
*/
function vc_set_default_content_for_post_type($post_content, $post)
{
if (!empty($post_content) || !vc_backend_editor()->isValidPostType($post->post_type)) {
return $post_content;
}
$template_settings = new Vc_Setting_Post_Type_Default_Template_Field('general', 'default_template_post_type');
if (($new_post_content = $template_settings->getTemplateByPostType($post->post_type)) !== null) {
add_filter('wpb_vc_js_status_filter', 'vc_set_default_content_for_post_type_wpb_vc_js_status_filter');
return $new_post_content;
}
return $post_content;
}
开发者ID:ksan5835,项目名称:maadithottam,代码行数:23,代码来源:post-type-default-template.php
示例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();
}
开发者ID:pivotlearning,项目名称:wpsite,代码行数:13,代码来源:js_composer.php
示例4: 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.
}
开发者ID:nignjatov,项目名称:TaxiDev,代码行数:17,代码来源:js_composer.php
示例5: contentAdmin
public function contentAdmin($atts, $content = null)
{
$width = $el_class = $title = '';
extract(shortcode_atts($this->predefined_atts, $atts));
$output = '';
$column_controls = $this->getColumnControls($this->settings('controls'));
$column_controls_bottom = $this->getColumnControls('add', 'bottom-controls');
if ($width == 'column_14' || $width == '1/4') {
$width = array('vc_span3');
} else {
if ($width == 'column_14-14-14-14') {
$width = array('vc_span3', 'vc_span3', 'vc_span3', 'vc_span3');
} else {
if ($width == 'column_13' || $width == '1/3') {
$width = array('vc_span4');
} else {
if ($width == 'column_13-23') {
$width = array('vc_span4', 'vc_span8');
} else {
if ($width == 'column_13-13-13') {
$width = array('vc_span4', 'vc_span4', 'vc_span4');
} else {
if ($width == 'column_12' || $width == '1/2') {
$width = array('vc_span6');
} else {
if ($width == 'column_12-12') {
$width = array('vc_span6', 'vc_span6');
} else {
if ($width == 'column_23' || $width == '2/3') {
$width = array('vc_span8');
} else {
if ($width == 'column_34' || $width == '3/4') {
$width = array('vc_span9');
} else {
if ($width == 'column_16' || $width == '1/6') {
$width = array('vc_span2');
} else {
$width = array('');
}
}
}
}
}
}
}
}
}
}
for ($i = 0; $i < count($width); $i++) {
$output .= '<div class="group wpb_sortable">';
$output .= '<h3><span class="tab-label"><%= params.title %></span></h3>';
$output .= '<div ' . $this->mainHtmlBlockParams($width, $i) . '>';
$output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[$i]), $column_controls);
$output .= '<div class="wpb_element_wrapper">';
$output .= '<div ' . $this->containerHtmlBlockParams($width, $i) . '>';
$output .= do_shortcode(shortcode_unautop($content));
$output .= vc_backend_editor()->getLayout()->getContainerHelper();
$output .= '</div>';
if (isset($this->settings['params'])) {
$inner = '';
foreach ($this->settings['params'] as $param) {
$param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : '';
if (is_array($param_value)) {
// Get first element from the array
reset($param_value);
$first_key = key($param_value);
$param_value = $param_value[$first_key];
}
$inner .= $this->singleParamHtmlHolder($param, $param_value);
}
$output .= $inner;
}
$output .= '</div>';
$output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[$i]), $column_controls_bottom);
$output .= '</div>';
$output .= '</div>';
}
return $output;
}
开发者ID:scottnkerr,项目名称:eeco,代码行数:79,代码来源:vc-accordion-tab.php
示例6: die
<?php
if (!defined('ABSPATH')) {
die('-1');
}
add_action('admin_enqueue_scripts', array(vc_backend_editor(), 'enqueueEditorScripts'));
add_action('admin_enqueue_scripts', array(visual_composer()->templatesPanelEditor(), 'enqueuePreviewScripts'));
add_filter('admin_body_class', array(visual_composer()->templatesPanelEditor(), 'addBodyClassTemplatePreview'));
do_action('vc-render-templates-preview-template');
global $menu, $submenu, $parent_file, $post_ID, $post, $post_type;
$post_ID = $editorPost->ID;
$post_type = $editorPost->post_type;
$post_title = trim($editorPost->post_title);
$nonce_action = $nonce_action = 'update-post_' . $post_ID;
$user_ID = isset($current_user) && isset($current_user->ID) ? (int) $current_user->ID : 0;
$form_action = 'editpost';
$menu = array();
remove_action('wp_head', 'print_emoji_detection_script');
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action('admin_print_scripts', 'print_emoji_detection_script');
remove_action('admin_print_styles', 'print_emoji_styles');
add_thickbox();
wp_enqueue_script('vc_editors-templates-preview-js');
wp_enqueue_media(array('post' => $post_ID));
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<style type="text/css">
#screen-meta, #adminmenumain, .notice {
display: none !important;
}
开发者ID:arkev,项目名称:IntelligentMode,代码行数:30,代码来源:vc_ui-template-preview.tpl.php
示例7: enqueuePreviewScripts
/**
* Enqueue required scripts for template preview
* @since 4.8
*/
public function enqueuePreviewScripts()
{
vc_backend_editor()->enqueueCss();
vc_backend_editor()->enqueueJs();
wp_enqueue_script('vc_editors-templates-preview-js');
}
开发者ID:ksan5835,项目名称:maadithottam,代码行数:10,代码来源:class-vc-templates-panel-editor.php
注:本文中的vc_backend_editor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论