當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPBMap::getShortCode方法代碼示例

本文整理匯總了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;
 }
開發者ID:scottnkerr,項目名稱:eeco,代碼行數:10,代碼來源:class-vc-shortcode-edit-form.php

示例2: OMWPBScParams

 function OMWPBScParams($tag)
 {
     $this->sc = $tag;
     $settings = WPBMap::getShortCode($tag);
     if (!empty($settings) && isset($settings['params'])) {
         $this->params = $settings['params'];
     }
 }
開發者ID:SayenkoDesign,項目名稱:ividf,代碼行數:8,代碼來源:misc.php

示例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')));
     // }
 }
開發者ID:GaryJones,項目名稱:TPWP,代碼行數:32,代碼來源:hook-vc-grid.php

示例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>' );
	}
開發者ID:verbazend,項目名稱:AWFA,代碼行數:6,代碼來源:class-vc-frontend-editor.php

示例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;
 }
開發者ID:venamax,項目名稱:trixandtrax-cl,代碼行數:10,代碼來源:composer.php

示例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));
 }
開發者ID:ksan5835,項目名稱:maadithottam,代碼行數:14,代碼來源:class-vc-edit-form-fields.php

示例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;
 }
開發者ID:polaris610,項目名稱:medicalhound,代碼行數:37,代碼來源:class-vc-base.php

示例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')));
        }
開發者ID:RDePoppe,項目名稱:luminaterealestate,代碼行數:31,代碼來源:shortcodes.php

示例9: settings

 /**
  * @param $name
  *
  * @return null
  */
 public function settings($name)
 {
     $settings = WPBMap::getShortCode($this->tag);
     return isset($settings[$name]) ? $settings[$name] : null;
 }
開發者ID:websideas,項目名稱:aquila,代碼行數:10,代碼來源:shortcodes.php

示例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);
}
開發者ID:syncopetwice,項目名稱:STG,代碼行數:12,代碼來源:helpers_api.php


注:本文中的WPBMap::getShortCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。