本文整理汇总了PHP中WPBMap类的典型用法代码示例。如果您正苦于以下问题:PHP WPBMap类的具体用法?PHP WPBMap怎么用?PHP WPBMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WPBMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: kt_add_option_to_vc
function kt_add_option_to_vc()
{
$color_arr = array('vc_btn', 'vc_icon', 'vc_tta_accordion', 'vc_tta_tabs', 'vc_tta_tour');
foreach ($color_arr as $item) {
$button_colors = WPBMap::getParam($item, 'color');
$button_colors['value'][esc_html__('Accent color', 'adroit')] = 'accent';
vc_update_shortcode_param($item, $button_colors);
}
$background_arr = array('vc_icon');
foreach ($background_arr as $item) {
$button_colors = WPBMap::getParam($item, 'background_color');
$button_colors['value'][esc_html__('Accent color', 'adroit')] = 'accent';
vc_update_shortcode_param($item, $button_colors);
}
$image_styles = WPBMap::getParam('vc_single_image', 'style');
$image_styles['value'][esc_html__('Border box', 'adroit')] = 'border-box';
$image_styles['value'][esc_html__('Border box Left', 'adroit')] = 'border-left';
$image_styles['value'][esc_html__('Border box Right', 'adroit')] = 'border-right';
$image_styles['value'][esc_html__('Creative Left', 'adroit')] = 'creative-left';
$image_styles['value'][esc_html__('Creative Right', 'adroit')] = 'creative-right';
$image_styles['value'][esc_html__('Creative When hover', 'adroit')] = 'creative-hover';
vc_update_shortcode_param('vc_single_image', $image_styles);
$icon_btn = array('i_type', 'i_icon_fontawesome', 'i_icon_openiconic', 'i_icon_typicons', 'i_icon_entypo', 'i_icon_linecons', 'i_icon_pixelicons', 'css_animation', 'el_class');
foreach ($icon_btn as $item) {
vc_remove_param('vc_btn', $item);
}
}
示例2: __construct
public function __construct()
{
// make sure all vc shortcodes are loaded (needed for ajax pagination)
if (method_exists('WPBMap', 'addAllMappedShortcodes')) {
WPBMap::addAllMappedShortcodes();
}
add_action('the_content', array($this, 'render_custom_css'));
// this adds the [Fields and Views] to editor of visual composers text element
if (array_key_exists('action', $_POST) && $_POST['action'] == 'vc_edit_form') {
add_filter('wpv_filter_dialog_for_editors_requires_post', '__return_false');
}
}
示例3: qode_remove_vc_image_zoom
function qode_remove_vc_image_zoom()
{
//Remove zoom from click action on single image
$param = WPBMap::getParam('vc_single_image', 'onclick');
unset($param['value']['Zoom']);
vc_update_shortcode_param('vc_single_image', $param);
}
示例4: zoShortcodeAddParams
/**
* Add Shortcode Params
*
* @return none
*/
function zoShortcodeAddParams()
{
$extra_params_folder = get_template_directory() . '/vc_params';
$files = zoFileScanDirectory($extra_params_folder, '/^zo_.*\\.php/');
if (!empty($files)) {
foreach ($files as $file) {
if (WPBMap::exists($file->name)) {
include $file->uri;
if (isset($params) && is_array($params)) {
foreach ($params as $param) {
if (is_array($param)) {
$param['group'] = __('Template', ZO_NAME);
$param['edit_field_class'] = isset($param['edit_field_class']) ? $param['edit_field_class'] . ' zo_custom_param vc_col-sm-12 vc_column' : 'zo_custom_param vc_col-sm-12 vc_column';
$param['class'] = 'zo-extra-param';
if (isset($param['template']) && !empty($param['template'])) {
if (!is_array($param['template'])) {
$param['template'] = array($param['template']);
}
$param['dependency'] = array("element" => "zo_template", "value" => $param['template']);
}
vc_add_param($file->name, $param);
}
}
}
}
}
}
}
示例5: laborator_vc_row_full_width
function laborator_vc_row_full_width()
{
# Full Width Param
$param = WPBMap::getParam('vc_row', 'full_width');
$param['value'][__('Full width', 'lab_composer')] = 'lab-full-width';
vc_update_shortcode_param('vc_row', $param);
}
示例6: cruxstore_add_option_to_vc
function cruxstore_add_option_to_vc()
{
$image_styles = WPBMap::getParam('vc_single_image', 'style');
$image_styles['value'][esc_html__('Border box inner 1', 'cruxstore')] = 'border-box-1';
$image_styles['value'][esc_html__('Border box inner 2', 'cruxstore')] = 'border-box-2';
$image_styles['value'][esc_html__('Zoom In', 'cruxstore')] = 'zoomin';
$image_styles['value'][esc_html__('Zoom Out', 'cruxstore')] = 'zoomout';
$image_styles['value'][esc_html__('Slide', 'cruxstore')] = 'slide';
$image_styles['value'][esc_html__('Shine', 'cruxstore')] = 'shine';
vc_update_shortcode_param('vc_single_image', $image_styles);
$accordion_styles = WPBMap::getParam('vc_tta_accordion', 'style');
$accordion_styles['value'][esc_html__('Outline Wrapper', 'cruxstore')] = 'wrapper';
$accordion_styles['value'][esc_html__('Outline Wrapper Shadow', 'cruxstore')] = 'wrapper shadow';
vc_update_shortcode_param('vc_tta_accordion', $accordion_styles);
$accordion_iconss = WPBMap::getParam('vc_tta_accordion', 'c_icon');
$accordion_iconss['value'][esc_html__('Arrow Circle', 'cruxstore')] = 'arrow-circle';
vc_update_shortcode_param('vc_tta_accordion', $accordion_iconss);
$tab_styles = WPBMap::getParam('vc_tta_tabs', 'style');
$tab_styles['value'][esc_html__('Outline Wrapper', 'cruxstore')] = 'wrapper';
$tab_styles['value'][esc_html__('Outline Wrapper Shadow', 'cruxstore')] = 'wrapper shadow';
vc_update_shortcode_param('vc_tta_tabs', $tab_styles);
$cta_styles = WPBMap::getParam('vc_cta', 'style');
$cta_styles['value'][esc_html__('Transparent', 'cruxstore')] = 'transparent';
vc_update_shortcode_param('vc_cta', $cta_styles);
$button_colors = WPBMap::getParam('vc_btn', 'color');
$button_colors['value'][esc_html__('Accent color', 'cruxstore')] = 'accent';
vc_update_shortcode_param('vc_btn', $button_colors);
}
示例7: callActivities
/**
* Call all stored activities.
*
* Called by init method. List of activities stored by $init_activity are created by other objects called after
* initialization.
*
* @since 4.2
* @access public
*/
protected function callActivities() {
while ( $activity = each( $this->init_activity ) ) {
list( $object, $method, $params ) = $activity[1];
if ( $object == 'mapper' ) {
switch ( $method ) {
case 'map':
WPBMap::map( $params['name'], $params['attributes'] );
break;
case 'drop_param':
WPBMap::dropParam( $params['name'], $params['attribute_name'] );
break;
case 'add_param':
WPBMap::addParam( $params['name'], $params['attribute'] );
break;
case 'mutate_param':
WPBMap::mutateParam( $params['name'], $params['attribute'] );
break;
case 'drop_shortcode':
WPBMap::dropShortcode( $params['name'] );
break;
case 'modify':
WPBMap::modify( $params['name'], $params['setting_name'], $params['value'] );
break;
}
}
}
}
示例8: check_vc
function check_vc($content)
{
if (class_exists('Vc_Base')) {
global $post;
$course_status = vibe_get_option('start_course');
$force_include_pages = apply_filters('wplms_vc_force_include_pages', array($course_status));
$force_include_post_types = apply_filters('wplms_vc_force_include_custom_post_types', array('course', 'unit', 'quiz', 'question'));
if (in_array($post->ID, $force_include_pages) || in_array($post->post_type, $force_include_post_types)) {
if (strpos($content, 'vc_row')) {
/*
wp_register_style( 'js_composer_front', vc_asset_url( 'css/js_composer.min.css' ), array(), WPB_VC_VERSION );
wp_register_script( 'wpb_composer_front_js', vc_asset_url( 'js/dist/js_composer_front.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );
wp_enqueue_style( 'js_composer_front');
wp_enqueue_script( 'wpb_composer_front_js');
*/
echo "<link rel='stylesheet' id='swiftype-css' href='" . vc_asset_url('css/js_composer.min.css') . "' type='text/css' media='all'/>";
echo "<script type='text/javascript' src='" . vc_asset_url('js/dist/js_composer_front.min.js') . "'></script>";
global $vc_manager;
foreach (WPBMap::getShortCodes() as $sc_base => $el) {
$vc_manager->shortcodes[$sc_base] = new WPBakeryShortCodeFishBones($el);
}
}
}
}
return $content;
}
示例9: update_params
/**
* Used to update default parms
*
* @since 3.0.0
* @access public
*/
public function update_params()
{
$param = WPBMap::getParam('vc_single_image', 'img_size');
if ($param) {
$param['value'] = 'full';
vc_update_shortcode_param('vc_single_image', $param);
}
}
示例10: wpb_map
/**
* WPBakery Visual Composer helpers functions
*
* @package WPBakeryVisualComposer
*
*/
function wpb_map($attributes)
{
if (!isset($attributes['base'])) {
trigger_error(__("Wrong wpb_map object. Base attribute is required", 'js_composer'), E_USER_ERROR);
die;
}
WPBMap::map($attributes['base'], $attributes);
}
示例11: add_cta_button_super_color
function add_cta_button_super_color()
{
//Get current values stored in the color param in "Call to Action" element
$param = WPBMap::getParam('vc_cta', 'color');
//Append new value to the 'value' array
$param['value'][__('WF', 'webidia')] = 'btn-wf-color';
$param['std'] = 'btn-wf-color';
//Finally "mutate" param with new values
vc_update_shortcode_param('vc_cta', $param);
}
示例12: 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;
}
示例13: lab_vc_tta_tabs_setup
function lab_vc_tta_tabs_setup()
{
$new_param = array('Theme Styled (if selected, other style settings will be ignored)' => 'theme-styled');
$new_param_minimal = array('Theme Styled Minimal (if selected, other style settings will be ignored)' => 'theme-styled-minimal');
$tabs_param = WPBMap::getParam('vc_tta_tabs', 'style');
$accordion_param = WPBMap::getParam('vc_tta_accordion', 'style');
$tabs_param['value'] = array_merge($new_param, $new_param_minimal, $tabs_param['value']);
$accordion_param['value'] = array_merge($new_param, $accordion_param['value']);
vc_update_shortcode_param('vc_tta_tabs', $tabs_param);
vc_update_shortcode_param('vc_tta_accordion', $accordion_param);
}
示例14: kt_add_option_to_vc
function kt_add_option_to_vc()
{
$image_styles = WPBMap::getParam('vc_single_image', 'style');
$image_styles['value'][esc_html__('Border box', 'mondova')] = 'border-box';
$image_styles['value'][esc_html__('Border box inner 1', 'mondova')] = 'border-box-1';
$image_styles['value'][esc_html__('Border box inner 2', 'mondova')] = 'border-box-2';
$image_styles['value'][esc_html__('Zoom In', 'mondova')] = 'zoomin';
$image_styles['value'][esc_html__('Zoom Out', 'mondova')] = 'zoomout';
$image_styles['value'][esc_html__('Slide', 'mondova')] = 'slide';
$image_styles['value'][esc_html__('Shine', 'mondova')] = 'shine';
vc_update_shortcode_param('vc_single_image', $image_styles);
}
示例15: om_wpb_sort_elements
/**
* Sort WPB Elements
*/
function om_wpb_sort_elements()
{
$elements = array('vc_row', 'vc_column_text', 'vc_separator', 'vc_text_separator', 'om_icon_separator', 'vc_message', 'vc_facebook', 'vc_tweetmeme', 'vc_googleplus', 'vc_pinterest', 'vc_toggle', 'vc_single_image', 'vc_gallery', 'vc_images_carousel', 'vc_tabs', 'vc_tour', 'vc_accordion', 'vc_btn', 'vc_cta', 'vc_icon', 'vc_video', 'vc_gmaps', 'vc_raw_html', 'vc_raw_js', 'vc_flickr', 'vc_progress_bar', 'vc_pie', 'vc_empty_space', 'vc_custom_heading', 'om_box', 'om_counter', 'om_a_button', 'om_pricing_table', 'om_pricing_table_column', 'om_html_table', 'om_posts', 'om_testimonials', 'om_portfolio', 'om_logos', 'om_chart', 'om_person', 'om_click_box', 'om_moving_box', 'om_click_icon_box', 'om_click_icon_box2', 'om_teaser');
$elements = array_reverse($elements);
$w = 10;
foreach ($elements as $v) {
if (WPBMap::exists($v)) {
vc_map_update($v, array('weight' => $w));
$w += 10;
}
}
}