本文整理汇总了PHP中WPBMap::getShortCode方法的典型用法代码示例。如果您正苦于以下问题:PHP WPBMap::getShortCode方法的具体用法?PHP WPBMap::getShortCode怎么用?PHP WPBMap::getShortCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPBMap
的用法示例。
在下文中一共展示了WPBMap::getShortCode方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
public function build()
{
$element = vc_post_param('element');
$shortCode = stripslashes(vc_post_param('shortcode'));
visual_composer()->removeShortCode($element);
$settings = WPBMap::getShortCode($element);
new WPBakeryShortCode_Settings($settings);
echo do_shortcode($shortCode);
die;
}
示例2: OMWPBScParams
function OMWPBScParams($tag)
{
$this->sc = $tag;
$settings = WPBMap::getShortCode($tag);
if (!empty($settings) && isset($settings['params'])) {
$this->params = $settings['params'];
}
}
示例3: getGridDataForAjax
/**
* @since 4.4
*
* @output/@return string - grid data for ajax request.
*/
public function getGridDataForAjax()
{
// if ( vc_request_param( 'action' ) === 'vc_get_vc_grid_data' ) {
if (vc_request_param('tag') === 'vc_masonry_grid') {
$settings = WPBMap::getShortCode('vc_masonry_grid');
require_once vc_path_dir('SHORTCODES_DIR', 'vc-masonry-grid.php');
$vc_grid = new WPBakeryShortcode_VC_Masonry_Grid($settings);
} else {
if (vc_request_param('tag') === 'vc_media_grid') {
$settings = WPBMap::getShortCode('vc_media_grid');
require_once vc_path_dir('SHORTCODES_DIR', 'vc-media-grid.php');
$vc_grid = new WPBakeryShortcode_VC_Media_Grid($settings);
} else {
if (vc_request_param('tag') === 'vc_masonry_media_grid') {
$settings = WPBMap::getShortCode('vc_masonry_media_grid');
require_once vc_path_dir('SHORTCODES_DIR', 'vc-masonry-media-grid.php');
$vc_grid = new WPBakeryShortcode_VC_Masonry_Media_Grid($settings);
} else {
$settings = WPBMap::getShortCode('vc_basic_grid');
require_once vc_path_dir('SHORTCODES_DIR', 'vc-basic-grid.php');
$vc_grid = new WPBakeryShortcode_VC_Basic_Grid($settings);
}
}
}
die($vc_grid->renderAjax(vc_request_param('data')));
// }
}
示例4: toString
function toString( $shortcode, $content ) {
$shortcode_settings = WPBMap::getShortCode( $shortcode['tag'] );
$is_container = ( isset( $shortcode_settings['is_container'] ) && $shortcode_settings['is_container'] === true ) || ( isset( $shortcode_settings['as_parent'] ) && $shortcode_settings['as_parent'] !== false );
return do_shortcode( '<div class="vc-element" data-tag="' . $shortcode['tag'] . '" data-model-id="' . $shortcode['id'] . '"' . self::cleanStyle() . '>' . $this->wrapperStart()
. '[' . $shortcode['tag'] . ' ' . $shortcode['attrs_query'] . ']' . ( $is_container ? '[vc_container_anchor]' : '' ) . $this->parseShortcodesString( $content, $is_container, $shortcode['id'] ) . '[/' . $shortcode['tag'] . ']' . $this->wrapperEnd() . '</div>' );
}
示例5: showEditFormJavascript_callback
public function showEditFormJavascript_callback()
{
$element = $this->post('element');
$shortCode = stripslashes($this->post('shortcode'));
$this->removeShortCode($element);
$settings = WPBMap::getShortCode($element);
new WPBakeryShortCode_Settings($settings);
echo do_shortcode($shortCode);
die;
}
示例6: __construct
/**
* Construct Form fields.
*
* @since 4.4
*
* @param $tag - shortcode tag
* @param $atts - list of attribute assign to the shortcode.
*/
public function __construct($tag, $atts)
{
$this->tag = $tag;
$this->atts = apply_filters('vc_edit_form_fields_attributes_' . $this->tag, $atts);
$this->setSettings(WPBMap::getShortCode($this->tag));
}
示例7: parseShortcodesCustomCss
/**
* Parse shortcodes custom css string.
*
* This function is used by self::buildShortcodesCustomCss and creates css string from shortcodes attributes
* like 'css_editor'.
*
* @see WPBakeryVisualComposerCssEditor
* @since 4.2
* @access public
*
* @param $content
*
* @return string
*/
public function parseShortcodesCustomCss($content)
{
$css = '';
if (!preg_match('/\\s*(\\.[^\\{]+)\\s*\\{\\s*([^\\}]+)\\s*\\}\\s*/', $content)) {
return $css;
}
preg_match_all('/' . get_shortcode_regex() . '/', $content, $shortcodes);
foreach ($shortcodes[2] as $index => $tag) {
$shortcode = WPBMap::getShortCode($tag);
$attr_array = shortcode_parse_atts(trim($shortcodes[3][$index]));
if (isset($shortcode['params']) && !empty($shortcode['params'])) {
foreach ($shortcode['params'] as $param) {
if ($param['type'] == 'css_editor' && isset($attr_array[$param['param_name']])) {
$css .= $attr_array[$param['param_name']];
}
}
}
}
foreach ($shortcodes[5] as $shortcode_content) {
$css .= $this->parseShortcodesCustomCss($shortcode_content);
}
return $css;
}
示例8: unset
$list['vc_button2'] = $shortcode_vc_button2;
$list['vc_button2']['post_type'] = Vc_Grid_Item_Editor::postType();
}
$shortcode_vc_btn = WPBMap::getShortCode('vc_btn');
if (is_array($shortcode_vc_btn) && isset($shortcode_vc_btn['base'])) {
$list['vc_btn'] = $shortcode_vc_btn;
$list['vc_btn']['post_type'] = Vc_Grid_Item_Editor::postType();
unset($list['vc_btn']['params'][1]);
}
$shortcode_vc_custom_heading = WPBMap::getShortCode('vc_custom_heading');
if (is_array($shortcode_vc_custom_heading) && isset($shortcode_vc_custom_heading['base'])) {
$list['vc_custom_heading'] = $shortcode_vc_custom_heading;
$list['vc_custom_heading']['post_type'] = Vc_Grid_Item_Editor::postType();
unset($list['vc_custom_heading']['params'][1]);
}
$shortcode_vc_empty_space = WPBMap::getShortCode('vc_empty_space');
if (is_array($shortcode_vc_empty_space) && isset($shortcode_vc_empty_space['base'])) {
$list['vc_empty_space'] = $shortcode_vc_empty_space;
$list['vc_empty_space']['post_type'] = Vc_Grid_Item_Editor::postType();
}
foreach (array('vc_icon', 'vc_button2', 'vc_btn', 'vc_custom_heading', 'vc_single_image') as $key) {
if (isset($list[$key])) {
if (!isset($list[$key]['params'])) {
$list[$key]['params'] = array();
}
if ('vc_button2' === $key) {
// change settings for vc_link in dropdown. Add dependency.
$list[$key]['params'][0] = array('type' => 'vc_link', 'heading' => __('URL (Link)', 'js_composer'), 'param_name' => 'url', 'dependency' => array('element' => 'link', 'value' => array('custom')), 'description' => __('Add custom link.', 'js_composer'));
} else {
array_unshift($list[$key]['params'], array('type' => 'vc_link', 'heading' => __('URL (Link)', 'js_composer'), 'param_name' => 'url', 'dependency' => array('element' => 'link', 'value' => array('custom')), 'description' => __('Add custom link.', 'js_composer')));
}
示例9: settings
/**
* @param $name
*
* @return null
*/
public function settings($name)
{
$settings = WPBMap::getShortCode($this->tag);
return isset($settings[$name]) ? $settings[$name] : null;
}
示例10: vc_get_shortcode
/**
* Get settings of the mapped shortcode.
*
* @param $tag
*
* @since 4.4.3
* @return array|null - settings or null if shortcode not mapped
*/
function vc_get_shortcode($tag)
{
return WPBMap::getShortCode($tag);
}