本文整理汇总了PHP中WPBMap::getUserShortCodes方法的典型用法代码示例。如果您正苦于以下问题:PHP WPBMap::getUserShortCodes方法的具体用法?PHP WPBMap::getUserShortCodes怎么用?PHP WPBMap::getUserShortCodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPBMap
的用法示例。
在下文中一共展示了WPBMap::getUserShortCodes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
public function output($post = null)
{
$output = $this->getNavBar()->getElementsModal();
$output .= $this->getNavBar()->output();
$output .= '
<div class="metabox-composer-content">
<div id="wpb-convert-message">
<div class="messagebox_text"><p>' . __('Your page layout was created with previous Visual Composer version. Before converting your layout to the new version, make sure to <a target="_blank" href="http://kb.wpbakery.com/index.php?title=Update_Visual_Composer_from_3.4_to_3.5">read this page</a>.', LANGUAGE_ZONE) . '</p>
<div class="wpb-convert-buttons">
<a class="wpb_convert button" id="wpb-convert"><i class="icon"></i>' . __('Convert to new version', LANGUAGE_ZONE) . '</a>
</div>
</div>
</div>
<div class="vc_loading_block" style="display: none;">
<img src="' . get_site_url() . '/wp-admin/images/wpspin_light.gif" /> ' . __("Loading, please wait...", LANGUAGE_ZONE) . '
</div>
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper"></div>
<div id="wpb-empty-blocks">
<h2>' . __("No content yet! You should add some...", LANGUAGE_ZONE) . '</h2>
<table class="helper-block">
<tr>
<td><span>1</span></td>
<td><p> ' . __("This is a visual preview of your page. Currently, you don't have any content elements. Click or drag the button <a href='#' class='add-element-to-layout'><i class='icon'></i> Add element</a> on the top to add content elements on your page. Alternatively add <a href='#' class='add-text-block-to-content' parent-container='#visual_composer_content'><i class='icon'></i> Text block</a> with single click.", LANGUAGE_ZONE) . '</p></td>
</tr>
</table>
<table class="helper-block">
<tr>
<td><span>2</span></td><td><p class="one-line"> ' . __("Click the pencil icon on the content elements to change their properties.", LANGUAGE_ZONE) . '</p></td>
</tr>
<tr>
<td colspan="2">
<div class="edit-picture"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="container-helper-block" style="display: none;">' . $this->getContainerHelper() . '</div>';
?>
<script type="text/javascript">
var vc_user_mapper = <?php
echo json_encode(WPBMap::getUserShortCodes());
?>
,
vc_mapper = <?php
echo json_encode(WPBMap::getShortCodes());
?>
;
</script>
<?php
$wpb_vc_status = get_post_meta($post->ID, '_wpb_vc_js_status', true);
$wpb_post_custom_css = get_post_meta($post->ID, '_wpb_post_custom_css', true);
if ($wpb_vc_status == "" || !isset($wpb_vc_status)) {
$wpb_vc_status = 'false';
}
$output .= '<input type="hidden" id="wpb_custom_post_css_field" name="wpb_vc_post_custom_css" value="' . htmlspecialchars($wpb_post_custom_css) . '" />';
$output .= '<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="' . $wpb_vc_status . '" />';
$output .= '<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="' . __("Loading, please wait...", LANGUAGE_ZONE) . '" />';
$output .= '<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="' . __("Crunching...", LANGUAGE_ZONE) . '" />';
$output .= '<input type="hidden" id="wpb_vc_js_interface_version" name="wpb_vc_js_interface_version" value="' . vc_get_initerface_version() . '" />';
echo $output;
require_once WPBakeryVisualComposer::config('COMPOSER') . 'templates/media_editor.php';
require_once WPBakeryVisualComposer::config('COMPOSER') . 'lib/params/loop/templates.html';
require_once WPBakeryVisualComposer::config('COMPOSER') . 'lib/params/options/templates.html';
}
示例2: array
$vc_settings_presets = Vc_Settings_Preset::listDefaultSettingsPresets();
$vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets();
} else {
$vc_settings_presets = array();
$vc_vendor_settings_presets = array();
}
// [/shortcodes presets data]
?>
<input type="hidden" name="vc_post_custom_css" id="vc_post-custom-css"
value="<?php
echo esc_attr($editor->post_custom_css);
?>
" autocomplete="off"/>
<script type="text/javascript">
var vc_user_mapper = <?php
echo json_encode(WPBMap::getUserShortCodes());
?>
,
vc_mapper = <?php
echo json_encode(WPBMap::getShortCodes());
?>
,
vc_vendor_settings_presets = <?php
echo json_encode($vc_vendor_settings_presets);
?>
,
vc_settings_presets = <?php
echo json_encode($vc_settings_presets);
?>
,
vc_roles = [], // @todo fix_roles BC for roles
示例3: enqueueMappedShortcode
/**
* Enqueue js/css files from mapped shortcodes.
*
* To add js/css files to this enqueue please add front_enqueue_js/front_enqueue_css setting in vc_map array.
* @since 4.3
*
*/
function enqueueMappedShortcode()
{
foreach (WPBMap::getUserShortCodes() as $shortcode) {
$param = isset($shortcode['front_enqueue_js']) ? $shortcode['front_enqueue_js'] : null;
if (is_array($param) && !empty($param)) {
foreach ($param as $value) {
$this->enqueueMappedShortcodeJs($value);
}
} elseif (is_string($param) && !empty($param)) {
$this->enqueueMappedShortcodeJs($param);
}
$param = isset($shortcode['front_enqueue_css']) ? $shortcode['front_enqueue_css'] : null;
if (is_array($param) && !empty($param)) {
foreach ($param as $value) {
$this->enqueueMappedShortcodeCss($value);
}
} elseif (is_string($param) && !empty($param)) {
$this->enqueueMappedShortcodeCss($param);
}
}
}
示例4: enqueueMappedShortcode
/**
* Enqueue js/css files from mapped shortcodes.
*
* To add js/css files to this enqueue please add front_enqueue_js/front_enqueue_css setting in vc_map array.
*/
function enqueueMappedShortcode()
{
foreach (WPBMap::getUserShortCodes() as $shortcode) {
if (!empty($shortcode['front_enqueue_js'])) {
wp_enqueue_script('front_enqueue_js_' . $shortcode['base'], $shortcode['front_enqueue_js'], array('vc_inline_custom_view_js'), WPB_VC_VERSION, true);
}
if (!empty($shortcode['front_enqueue_css'])) {
wp_enqueue_style('front_enqueue_css_' . $shortcode['base'], $shortcode['front_enqueue_css'], array('vc_inline_css'), WPB_VC_VERSION, 'all');
}
}
}
示例5: output
public function output($post = null)
{
$output = $this->getNavBar()->getElementsModal();
$output .= $this->getNavBar()->output();
$output .= '
<div class="metabox-composer-content">
<div class="vc_loading_block" style="display: none;">
<img src="' . get_site_url() . '/wp-admin/images/wpspin_light.gif" /> ' . __("Loading, please wait...", "js_composer") . '
</div>
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper"></div>
<div id="wpb-empty-blocks">
<h2>' . __("No content yet! You should add some...", "js_composer") . '</h2>
<table class="helper-block">
<tr>
<td><span>1</span></td>
<td><p> ' . __("This is a visual preview of your page. Currently, you don't have any content elements. Click or drag the button <a href='#' class='add-element-to-layout'><i class='icon'></i> Add element</a> on the top to add content elements on your page. Alternatively add <a href='#' class='add-text-block-to-content' parent-container='#visual_composer_content'><i class='icon'></i> Text block</a> with single click.", "js_composer") . '</p></td>
</tr>
</table>
<table class="helper-block">
<tr>
<td><span>2</span></td><td><p class="one-line"> ' . __("Click the pencil icon on the content elements to change their properties.", "js_composer") . '</p></td>
</tr>
<tr>
<td colspan="2">
<div class="edit-picture"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="container-helper-block" style="display: none;">' . $this->getContainerHelper() . '</div>';
?>
<script type="text/javascript">
var vc_user_mapper = <?php
echo json_encode(WPBMap::getUserShortCodes());
?>
,
vc_mapper = <?php
echo json_encode(WPBMap::getShortCodes());
?>
,
vc_frontend_enabled = <?php
echo vc_enabled_frontend() ? 'true' : 'false';
?>
;
</script>
<?php
$wpb_vc_status = apply_filters('wpb_vc_js_status_filter', vc_get_param('wpb_vc_js_status', get_post_meta($post->ID, '_wpb_vc_js_status', true)));
$wpb_post_custom_css = get_post_meta($post->ID, '_wpb_post_custom_css', true);
if ($wpb_vc_status == "" || !isset($wpb_vc_status)) {
$wpb_vc_status = 'false';
}
$output .= '<input type="hidden" id="wpb_custom_post_css_field" name="wpb_vc_post_custom_css" value="' . htmlspecialchars($wpb_post_custom_css) . '" />';
$output .= '<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="' . $wpb_vc_status . '" />';
$output .= '<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="' . __("Loading, please wait...", "js_composer") . '" />';
$output .= '<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="' . __("Crunching...", "js_composer") . '" />';
$output .= '<input type="hidden" id="wpb_vc_js_interface_version" name="wpb_vc_js_interface_version" value="' . vc_get_initerface_version() . '" />';
echo $output;
require_once vc_path_dir('TEMPLATES_DIR', 'backend_editor/templates.php');
do_action('vc_backend_editor_render');
}
示例6: _e
</ul>
</div>
</div>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-default vc-close"
data-dismiss="panel"><?php _e( 'Close', 'js_composer' ) ?></button>
</div>
</div>
<ol id="vc-breadcrumb" class="breadcrumb">
<li class="root">Visual Composer</li>
</ol>
<script type="text/javascript">
var vc_user_mapper = <?php echo json_encode(WPBMap::getUserShortCodes()) ?>,
vc_mapper = <?php echo json_encode(WPBMap::getShortCodes()) ?>;
</script>
<div data-type="text/html" id="vc-template-post-content" style="display: none;">
<?php $this->getPageShortcodes() ?>
<div id="vc-no-content-helper" class="vc-no-content-helper">
<span class="icon"></span>
<h5><?php _e('Welcome to Blank Page', 'js_composer') ?></h5>
<h3><?php _e('You Have No Content Yet! Add Some...', 'js_composer') ?></h3>
<div class="vc-buttons">
<a id="vc-not-empty-add-element" class="vc-add-element-not-empty-button vc-add-element-action"
title="<?php _e( 'Add element', 'js_composer' ) ?>"></a>
<a id="vc-no-content-add-element"
示例7: getContentLayouts
public function getContentLayouts()
{
$output = '<li><ul class="wpb-content-layouts">';
// $output .= $this->getColumnLayouts();
foreach (WPBMap::getUserShortCodes() as $sc_base => $el) {
if (isset($el['content_element']) && $el['content_element'] === false) {
continue;
}
//ql $sc_base=="vc_row"
$element_button = new WPBakeryVisualComposerElementButton();
$output .= $element_button->setBase($sc_base)->setup($el)->output();
}
$output .= '</ul></li>';
return $output;
}