/** * Build edit form fields. * * @since 4.4 */ public function renderFields() { /* nectar addition */ $tag = vc_post_param('tag'); vc_user_access()->checkAdminNonce()->validateDie(__('Access denied', 'js_composer'))->wpAny(array('edit_post', (int) vc_request_param('post_id')))->validateDie(__('Access denied', 'js_composer'))->check('vc_user_access_check_shortcode_edit', $tag)->validateDie(__('Access denied', 'js_composer')); function array_htmlspecialchars_decode(&$input) { if (is_array($input)) { foreach ($input as $key => $value) { if (is_array($value)) { $input[$key] = array_htmlspecialchars_decode($value); } else { $input[$key] = htmlspecialchars_decode($value); } } return $input; } return htmlspecialchars_decode($input); } $params = array_map('array_htmlspecialchars_decode', (array) stripslashes_deep(vc_post_param('params'))); require_once vc_path_dir('EDITORS_DIR', 'class-vc-edit-form-fields.php'); $fields = new Vc_Edit_Form_Fields($tag, $params); $fields->render(); die; /* nectar addition end */ }
/** * Build edit form fields. * * @since 4.4 */ public function renderFields() { $tag = vc_post_param('tag'); vc_user_access()->checkAdminNonce()->validateDie(__('Access denied', 'js_composer'))->wpAny(array('edit_post', (int) vc_request_param('post_id')))->validateDie(__('Access denied', 'js_composer'))->check('vc_user_access_check_shortcode_edit', $tag)->validateDie(__('Access denied', 'js_composer')); $params = array_map('vc_htmlspecialchars_decode_deep', (array) stripslashes_deep(vc_post_param('params'))); require_once vc_path_dir('EDITORS_DIR', 'class-vc-edit-form-fields.php'); $fields = new Vc_Edit_Form_Fields($tag, $params); $fields->render(); die; }
function vc_roles_settings_save() { if (check_admin_referer('vc_settings-roles-action', 'vc_nonce_field') && current_user_can('manage_options')) { require_once vc_path_dir('SETTINGS_DIR', 'class-vc-roles.php'); $vc_roles = new Vc_Roles(); $data = $vc_roles->save(vc_request_param('vc_roles', array())); echo json_encode($data); die; } }
/** * Set required objects to render editor for grid item * * @since 4.4 */ function vc_grid_item_editor_init() { require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php'); $vc_grid_item_editor = new Vc_Grid_Item_Editor(); if (vc_request_param('vc_grid_item_editor') === 'true') { require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php'); $grid_item = new Vc_Grid_Item(); $grid_item->mapShortcodes(); } $vc_grid_item_editor->addMetaBox(); }
public function render() { $this->post_id = vc_request_param('post_id'); $this->shortcodes_string = stripslashes(vc_request_param('shortcodes_string', true)); require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php'); $grid_item = new Vc_Grid_Item(); $grid_item->setIsEnd(false); $grid_item->setGridAttributes(array('element_width' => 4)); $grid_item->setTemplate($this->shortcodes_string, $this->post_id); $this->enqueue(); vc_include_template('params/vc_grid_item/preview.tpl.php', array('preview' => $this, 'grid_item' => $grid_item, 'shortcodes_string' => $this->shortcodes_string, 'post' => $this->mockingPost(), 'default_width_value' => apply_filters('vc_grid_item_preview_render_default_width_value', 4))); }
public function setItemsIfEmpty($items) { if (empty($items)) { require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php'); $grid_item = new Vc_Grid_Item(); $grid_item->setGridAttributes($this->atts); $grid_item->shortcodes(); $item = '[vc_gitem]<img src="' . vc_asset_url('vc/vc_gitem_image.png') . '">[/vc_gitem]'; $grid_item->parseTemplate($item); $items = str_repeat($grid_item->renderItem(get_post((int) vc_request_param('vc_post_id'))), 3); } return $items; }
/** * Calls add_meta_box to create Editor block. Block is rendered by WPBakeryVisualComposerLayout. * * @see WPBakeryVisualComposerLayout * @since 4.2 * @access public */ public function render() { // @todo fix_roles bc for post_types, maybe initialize ajax hooks also when we are inside vc_editor_post_types? global $pagenow; if ('post.php' === $pagenow) { do_action('vc_backend_editor_before_render'); // we editing existing entity $id = (int) vc_request_param('post'); // @todo add check if vc is enabled for this post_type $type = get_post_type($id); $valid = vc_check_post_type($type); if ($valid) { add_meta_box('wpb_visual_composer', __('Visual Composer', 'js_composer'), array(&$this, 'renderEditor'), $type, 'normal', 'high'); } } elseif ('post-new.php' === $pagenow) { // we creating new entitiy $type = sanitize_text_field(vc_request_param('post_type')); $type = empty($type) ? 'post' : $type; $valid = vc_check_post_type($type); if ($valid) { add_meta_box('wpb_visual_composer', __('Visual Composer', 'js_composer'), array(&$this, 'renderEditor'), $type, 'normal', 'high'); } } }
/** * Get is inline or not. * @since 4.2 * @return bool */ function vc_is_inline() { global $vc_is_inline; if (is_null($vc_is_inline)) { $vc_is_inline = vc_action() === 'vc_inline' || !is_null(vc_request_param('vc_inline')) || vc_request_param('vc_editable') === 'true'; } return $vc_is_inline; }
/** * Check and Map grid element shortcodes if required. * @since 4.5 */ function vc_grid_item_editor_shortcodes() { require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php'); // TODO: remove this because mapping can be based on post_type if ('true' === vc_request_param('vc_grid_item_editor') || is_admin() && vc_grid_item_get_post_type() === Vc_Grid_Item_Editor::postType() && vc_user_access()->wpAny('edit_posts', 'edit_pages')->part('grid_builder')->can()->get()) { global $vc_grid_item_editor; add_action('vc_user_access_check-shortcode_edit', array(&$vc_grid_item_editor, 'accessCheckShortcodeEdit'), 10, 2); add_action('vc_user_access_check-shortcode_all', array(&$vc_grid_item_editor, 'accessCheckShortcodeAll'), 10, 2); vc_grid_item_map_shortcodes(); } }
/** * Set VC mode. * * Mode depends on which page is requested by client from server and request parameters like vc_action. * * @since 4.2 * @access protected * * @return void */ protected function setMode() { /** * TODO: Create another system (When ajax rebuild). * Use vc_action param to define mode. * 1. admin_frontend_editor - set by editor or request param * 2. admin_backend_editor - set by editor or request param * 3. admin_frontend_editor_ajax - set by request param * 4. admin_backend_editor_ajax - set by request param * 5. admin_updater - by vc_action * 6. page_editable - by vc_action */ if ( is_admin() ) { if ( vc_action() === 'vc_inline' && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) { $this->mode = 'admin_frontend_editor'; } elseif ( ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) && ( vc_action() === 'vc_upgrade' || ( vc_get_param( 'action' ) === 'update-selected' && vc_get_param( 'plugins' ) === $this->pluginName() ) ) ) { $this->mode = 'admin_updater'; } elseif ( current_user_can( 'manage_options' ) && isset( $_GET['page'] ) && $_GET['page'] === $this->settings()->page() ) { $this->mode = 'admin_settings_page'; } else { $this->mode = 'admin_page'; } } else { if ( vc_verify_admin_nonce() && current_user_can( 'edit_post', (int) vc_request_param( 'vc_post_id' ) ) && isset( $_GET['vc_editable'] ) && 'true' === $_GET['vc_editable'] ) { $this->mode = 'page_editable'; } else { $this->mode = 'page'; } } }
* Shortcode attributes * @var $atts * @var $css * @var $animation * @var $content - shortcode content * Shortcode class * @var $this WPBakeryShortCode_VC_Gitem_Animated_Block */ $css = $animation = $animation_attr = ''; extract(shortcode_atts(array('css' => '', 'animation' => ''), $atts)); $css_style = ''; $css_class = 'vc_gitem-animated-block ' . vc_shortcode_custom_css_class($css, ' '); if (!empty($animation)) { $css_class .= ' vc_gitem-animate vc_gitem-animate-' . $animation; $animation_attr .= ' data-vc-animation="' . esc_attr($animation) . '"'; } elseif ('vc_gitem_preview' !== vc_request_param('action') && vc_verify_admin_nonce() && (current_user_can('edit_posts') || current_user_can('edit_pages'))) { $content = preg_replace('/(?<=\\[)(vc_gitem_zone_b\\b)/', '$1 render="no"', $content); } ?> <div class="<?php echo esc_attr($css_class); ?> "<?php echo $animation_attr; echo empty($css_style) ? '' : ' style="' . esc_attr($css_style) . '"'; ?> ><?php echo do_shortcode($content); ?> </div>
/** * @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'))); // } }
/** * Set VC mode. * * Mode depends on which page is requested by client from server and request parameters like vc_action. * * @since 4.2 * @access protected * * @return void */ protected function setMode() { /** * TODO: Create another system (When ajax rebuild). * Use vc_action param to define mode. * 1. admin_frontend_editor - set by editor or request param * 2. admin_backend_editor - set by editor or request param * 3. admin_frontend_editor_ajax - set by request param * 4. admin_backend_editor_ajax - set by request param * 5. admin_updater - by vc_action * 6. page_editable - by vc_action */ if (is_admin()) { if ('vc_inline' === vc_action()) { vc_user_access()->wpAny(array('edit_post', (int) vc_request_param('post_id')))->validateDie()->part('frontend_editor')->can()->validateDie(); $this->mode = 'admin_frontend_editor'; } elseif (vc_user_access()->wpAny('edit_posts', 'edit_pages')->get() && ('vc_upgrade' === vc_action() || 'update-selected' === vc_get_param('action') && $this->pluginName() === vc_get_param('plugins'))) { $this->mode = 'admin_updater'; } elseif (vc_user_access()->wpAny('manage_options')->get() && isset($_GET['page']) && $_GET['page'] === $this->settings()->page()) { $this->mode = 'admin_settings_page'; } else { $this->mode = 'admin_page'; } } else { if (isset($_GET['vc_editable']) && 'true' === $_GET['vc_editable']) { vc_user_access()->checkAdminNonce()->validateDie()->wpAny(array('edit_post', (int) vc_request_param('vc_post_id')))->validateDie()->part('frontend_editor')->can()->validateDie(); $this->mode = 'page_editable'; } else { $this->mode = 'page'; } } }
/** * Add image url as href with css classes for PrettyPhoto js plugin. * * @param $value * @param $data * * @return string */ function vc_gitem_template_attribute_post_image_url_attr_prettyphoto($value, $data) { $data_default = $data; /** * @var Wp_Post $post ; */ extract(array_merge(array('post' => null, 'data' => ''), $data)); $href = vc_gitem_template_attribute_post_image_url_href($value, array('post' => $post, 'data' => '')); $rel = ' rel="' . esc_attr('prettyPhoto[rel-' . md5(vc_request_param('shortcode_id')) . ']') . '"'; return $href . $rel . ' class="' . esc_attr($data . (strlen($href) ? ' prettyphoto' : '')) . '" title="' . esc_attr(apply_filters('vc_gitem_template_attribute_post_title', $post->post_title, $data_default)) . '"'; }
/** * Check and Map grid element shortcodes if required. * @since 4.5 */ function vc_grid_item_editor_shortcodes() { require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php'); // @todo remove this because mapping can be based on post_type if (vc_request_param('vc_grid_item_editor') === 'true' || is_admin() && vc_grid_item_get_post_type() === Vc_Grid_Item_Editor::postType()) { vc_grid_item_map_shortcodes(); } }
} function vc_colors_arr() { return array(__('Grey', 'js_composer') => 'wpb_button', __('Blue', 'js_composer') => 'btn-primary', __('Turquoise', 'js_composer') => 'btn-info', __('Green', 'js_composer') => 'btn-success', __('Orange', 'js_composer') => 'btn-warning', __('Red', 'js_composer') => 'btn-danger', __('Black', 'js_composer') => 'btn-inverse'); } // Used in "Button" and "Call to Action" blocks function vc_size_arr() { return array(__('Regular', 'js_composer') => 'wpb_regularsize', __('Large', 'js_composer') => 'btn-large', __('Small', 'js_composer') => 'btn-small', __('Mini', 'js_composer') => 'btn-mini'); } function vc_icons_arr() { return array(__('None', 'js_composer') => 'none', __('Address book icon', 'js_composer') => 'wpb_address_book', __('Alarm clock icon', 'js_composer') => 'wpb_alarm_clock', __('Anchor icon', 'js_composer') => 'wpb_anchor', __('Application Image icon', 'js_composer') => 'wpb_application_image', __('Arrow icon', 'js_composer') => 'wpb_arrow', __('Asterisk icon', 'js_composer') => 'wpb_asterisk', __('Hammer icon', 'js_composer') => 'wpb_hammer', __('Balloon icon', 'js_composer') => 'wpb_balloon', __('Balloon Buzz icon', 'js_composer') => 'wpb_balloon_buzz', __('Balloon Facebook icon', 'js_composer') => 'wpb_balloon_facebook', __('Balloon Twitter icon', 'js_composer') => 'wpb_balloon_twitter', __('Battery icon', 'js_composer') => 'wpb_battery', __('Binocular icon', 'js_composer') => 'wpb_binocular', __('Document Excel icon', 'js_composer') => 'wpb_document_excel', __('Document Image icon', 'js_composer') => 'wpb_document_image', __('Document Music icon', 'js_composer') => 'wpb_document_music', __('Document Office icon', 'js_composer') => 'wpb_document_office', __('Document PDF icon', 'js_composer') => 'wpb_document_pdf', __('Document Powerpoint icon', 'js_composer') => 'wpb_document_powerpoint', __('Document Word icon', 'js_composer') => 'wpb_document_word', __('Bookmark icon', 'js_composer') => 'wpb_bookmark', __('Camcorder icon', 'js_composer') => 'wpb_camcorder', __('Camera icon', 'js_composer') => 'wpb_camera', __('Chart icon', 'js_composer') => 'wpb_chart', __('Chart pie icon', 'js_composer') => 'wpb_chart_pie', __('Clock icon', 'js_composer') => 'wpb_clock', __('Fire icon', 'js_composer') => 'wpb_fire', __('Heart icon', 'js_composer') => 'wpb_heart', __('Mail icon', 'js_composer') => 'wpb_mail', __('Play icon', 'js_composer') => 'wpb_play', __('Shield icon', 'js_composer') => 'wpb_shield', __('Video icon', 'js_composer') => 'wpb_video'); } require_once vc_path_dir('CONFIG_DIR', 'grids/vc-grids-functions.php'); if ('vc_get_autocomplete_suggestion' === vc_request_param('action') || 'vc_edit_form' === vc_post_param('action')) { add_filter('vc_autocomplete_vc_basic_grid_include_callback', 'vc_include_field_search', 10, 1); // Get suggestion(find). Must return an array add_filter('vc_autocomplete_vc_basic_grid_include_render', 'vc_include_field_render', 10, 1); // Render exact product. Must return an array (label,value) add_filter('vc_autocomplete_vc_masonry_grid_include_callback', 'vc_include_field_search', 10, 1); // Get suggestion(find). Must return an array add_filter('vc_autocomplete_vc_masonry_grid_include_render', 'vc_include_field_render', 10, 1); // Render exact product. Must return an array (label,value) // Narrow data taxonomies add_filter('vc_autocomplete_vc_basic_grid_taxonomies_callback', 'vc_autocomplete_taxonomies_field_search', 10, 1); add_filter('vc_autocomplete_vc_basic_grid_taxonomies_render', 'vc_autocomplete_taxonomies_field_render', 10, 1); add_filter('vc_autocomplete_vc_masonry_grid_taxonomies_callback', 'vc_autocomplete_taxonomies_field_search', 10, 1); add_filter('vc_autocomplete_vc_masonry_grid_taxonomies_render', 'vc_autocomplete_taxonomies_field_render', 10, 1); // Narrow data taxonomies for exclude_filter add_filter('vc_autocomplete_vc_basic_grid_exclude_filter_callback', 'vc_autocomplete_taxonomies_field_search', 10, 1);
"/> <input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="true"/> <input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="<?php _e('Loading, please wait...', 'js_composer'); ?> "/> <input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="<?php _e('Crunching...', 'js_composer'); ?> "/> <input type="hidden" name="vc_grid_item_editor" value="true"/> <script type="text/javascript"> <?php $vc_gitem_template = vc_request_param('vc_gitem_template'); if (strlen($vc_gitem_template) && false !== ($template = Vc_Grid_Item::predefinedTemplate($vc_gitem_template))) { echo "var vcDefaultGridItemContent = '" . $template['template'] . "';"; } else { ?> /** * Get content of grid item editor of current post. Data is used as models collection of shortcodes. * Data always wrapped with vc_gitem shortcode. * @return {*} */ var vcDefaultGridItemContent = '' + '[vc_gitem]' + '[vc_gitem_animated_block]' + '[vc_gitem_zone_a]' + '[vc_gitem_row position="top"]' + '[vc_gitem_col width="1/1"][/vc_gitem_col]' +
/** * Check license key from remote * * Function is used by support portal to check if VC w/ specific license is still installed */ public function checkLicenseKeyFromRemote() { $license_key = vc_request_param('license_key'); if (!$this->isValid($license_key)) { $response = array('status' => false, 'error' => __('Invalid license key', 'js_composer')); } else { $response = array('status' => true); } die(json_encode($response)); }
/** * @since 4.4 * * @output/@return string - grid data for ajax request. */ public function getGridDataForAjax() { $tag = vc_request_param('tag'); $allowed = apply_filters('vc_grid_get_grid_data_access', vc_verify_public_nonce() && $tag, $tag); if ($allowed) { $shortcode_fishbone = visual_composer()->getShortCode($tag); if (is_object($shortcode_fishbone)) { /** @var $vc_grid WPBakeryShortcode_Vc_Basic_Grid */ $vc_grid = $shortcode_fishbone->shortcodeClass(); if (method_exists($vc_grid, 'isObjectPageable') && $vc_grid->isObjectPageable() && method_exists($vc_grid, 'renderAjax')) { echo $vc_grid->renderAjax(vc_request_param('data')); die; } } } }
<?php if (!defined('ABSPATH')) { die('-1'); } /** * Build and enqueue js/css for automapper settings tab. * @since 4.5 */ function vc_automapper_init() { if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-automapper-tab')->get()) { vc_automapper()->addAjaxActions(); } } /** * Returns automapper template. * * @since 4.5 * @return string */ function vc_page_automapper_build() { return 'pages/vc-settings/vc-automapper.php'; } // TODO: move to separate file in autoload add_filter('vc_settings-render-tab-vc-automapper', 'vc_page_automapper_build'); is_admin() && ('vc_automapper' === vc_request_param('action') || 'vc-automapper' === vc_get_param('page')) && add_action('admin_init', 'vc_automapper_init');
/** * @param $nonce * * @return bool */ function vc_verify_public_nonce($nonce = '') { return (bool) vc_verify_nonce(!empty($nonce) ? $nonce : vc_request_param('_vcnonce'), 'vc-public-nonce'); }
/** * Load default template content by index from ajax * @since 4.4 * * @param bool $return | should function return data or not * * @return string */ public function getBackendDefaultTemplate($return = false) { $template_index = (int) vc_request_param('template_unique_id'); $data = $this->getDefaultTemplate($template_index); if (!$data) { die('Error: Vc_Templates_Panel_Editor::getBackendDefaultTemplate:1'); } if ($return) { return trim($data['content']); } else { echo trim($data['content']); die; } }
/** * @since 4.4 * * @output/@return string - grid data for ajax request. */ public function getGridDataForAjax() { $tag = vc_request_param('tag'); if (vc_verify_public_nonce() && $tag) { $shorcode_fishbone = visual_composer()->getShortCode($tag); if (is_object($shorcode_fishbone)) { /** @var $vc_grid WPBakeryShortcode_Vc_Basic_Grid */ $vc_grid = $shorcode_fishbone->shortcodeClass(); if (method_exists($vc_grid, 'isObjectPageable') && $vc_grid->isObjectPageable() && method_exists($vc_grid, 'renderAjax')) { die($vc_grid->renderAjax(vc_request_param('data'))); } } } }
} function vc_colors_arr() { return array(__('Grey', 'js_composer') => 'wpb_button', __('Blue', 'js_composer') => 'btn-primary', __('Turquoise', 'js_composer') => 'btn-info', __('Green', 'js_composer') => 'btn-success', __('Orange', 'js_composer') => 'btn-warning', __('Red', 'js_composer') => 'btn-danger', __('Black', 'js_composer') => 'btn-inverse'); } // Used in "Button" and "Call to Action" blocks function vc_size_arr() { return array(__('Regular', 'js_composer') => 'wpb_regularsize', __('Large', 'js_composer') => 'btn-large', __('Small', 'js_composer') => 'btn-small', __('Mini', 'js_composer') => 'btn-mini'); } function vc_icons_arr() { return array(__('None', 'js_composer') => 'none', __('Address book icon', 'js_composer') => 'wpb_address_book', __('Alarm clock icon', 'js_composer') => 'wpb_alarm_clock', __('Anchor icon', 'js_composer') => 'wpb_anchor', __('Application Image icon', 'js_composer') => 'wpb_application_image', __('Arrow icon', 'js_composer') => 'wpb_arrow', __('Asterisk icon', 'js_composer') => 'wpb_asterisk', __('Hammer icon', 'js_composer') => 'wpb_hammer', __('Balloon icon', 'js_composer') => 'wpb_balloon', __('Balloon Buzz icon', 'js_composer') => 'wpb_balloon_buzz', __('Balloon Facebook icon', 'js_composer') => 'wpb_balloon_facebook', __('Balloon Twitter icon', 'js_composer') => 'wpb_balloon_twitter', __('Battery icon', 'js_composer') => 'wpb_battery', __('Binocular icon', 'js_composer') => 'wpb_binocular', __('Document Excel icon', 'js_composer') => 'wpb_document_excel', __('Document Image icon', 'js_composer') => 'wpb_document_image', __('Document Music icon', 'js_composer') => 'wpb_document_music', __('Document Office icon', 'js_composer') => 'wpb_document_office', __('Document PDF icon', 'js_composer') => 'wpb_document_pdf', __('Document Powerpoint icon', 'js_composer') => 'wpb_document_powerpoint', __('Document Word icon', 'js_composer') => 'wpb_document_word', __('Bookmark icon', 'js_composer') => 'wpb_bookmark', __('Camcorder icon', 'js_composer') => 'wpb_camcorder', __('Camera icon', 'js_composer') => 'wpb_camera', __('Chart icon', 'js_composer') => 'wpb_chart', __('Chart pie icon', 'js_composer') => 'wpb_chart_pie', __('Clock icon', 'js_composer') => 'wpb_clock', __('Fire icon', 'js_composer') => 'wpb_fire', __('Heart icon', 'js_composer') => 'wpb_heart', __('Mail icon', 'js_composer') => 'wpb_mail', __('Play icon', 'js_composer') => 'wpb_play', __('Shield icon', 'js_composer') => 'wpb_shield', __('Video icon', 'js_composer') => 'wpb_video'); } require_once vc_path_dir('CONFIG_DIR', 'grids/vc-grids-functions.php'); if ('vc_get_autocomplete_suggestion' === vc_request_param('action')) { add_filter('vc_autocomplete_vc_basic_grid_include_callback', 'vc_include_field_search', 10, 1); // Get suggestion(find). Must return an array add_filter('vc_autocomplete_vc_basic_grid_include_render', 'vc_include_field_render', 10, 1); // Render exact product. Must return an array (label,value) add_filter('vc_autocomplete_vc_masonry_grid_include_callback', 'vc_include_field_search', 10, 1); // Get suggestion(find). Must return an array add_filter('vc_autocomplete_vc_masonry_grid_include_render', 'vc_include_field_render', 10, 1); // Render exact product. Must return an array (label,value) // Narrow data taxonomies add_filter('vc_autocomplete_vc_basic_grid_taxonomies_callback', 'vc_autocomplete_taxonomies_field_search', 10, 1); add_filter('vc_autocomplete_vc_basic_grid_taxonomies_render', 'vc_autocomplete_taxonomies_field_render', 10, 1); add_filter('vc_autocomplete_vc_masonry_grid_taxonomies_callback', 'vc_autocomplete_taxonomies_field_search', 10, 1); add_filter('vc_autocomplete_vc_masonry_grid_taxonomies_render', 'vc_autocomplete_taxonomies_field_render', 10, 1); // Narrow data taxonomies for exclude_filter add_filter('vc_autocomplete_vc_basic_grid_exclude_filter_callback', 'vc_autocomplete_taxonomies_field_search', 10, 1);
if (strlen($link['title'])) { $title = $link['title']; } $link = 'a href="' . esc_attr($link['url']) . '" class="' . esc_attr($link_css_class) . '"'; } elseif ('post_link' === $atts['link']) { $link = 'a href="' . get_permalink($post->ID) . '" class="' . esc_attr($link_css_class) . '"'; if (!strlen($title)) { $title = the_title('', '', false); } } elseif ('image' === $atts['link']) { $href_link = vc_gitem_template_attribute_post_image_url('', array('post' => $post, 'data' => '')); $link = 'a href="' . $href_link . '" class="' . esc_attr($link_css_class) . '"'; } elseif ('image_lightbox' === $atts['link']) { $link = 'a' . vc_gitem_template_attribute_post_image_url_attr_prettyphoto('', array('post' => $post, 'data' => $link_css_class)); } } if (strlen($title) > 0) { $title_attr = ' title="' . esc_attr($title) . '"'; } return apply_filters('vc_gitem_post_data_get_link_real_link', $link, $atts, $post, $link_css_class) . apply_filters('vc_gitem_post_data_get_link_real_target', $target, $atts, $post) . apply_filters('vc_gitem_post_data_get_link_real_title', $title_attr, $atts); } function vc_gitem_post_data_get_link_link_frontend_editor($link) { return empty($link) ? 'a' : $link; } if ('true' === vc_request_param('vc_editable')) { add_filter('vc_gitem_post_data_get_link_link', 'vc_gitem_post_data_get_link_link_frontend_editor'); add_filter('vc_gitem_post_data_get_link_real_link', 'vc_gitem_post_data_get_link_link_frontend_editor'); add_filter('vc_gitem_post_data_get_link_target', 'vc_gitem_post_data_get_link_target_frontend_editor'); add_filter('vc_gitem_post_data_get_link_real_target', 'vc_gitem_post_data_get_link_target_frontend_editor'); }
* @var $atts * @var $css * @var $animation * @var $bgimage * @var $content - shortcode content * Shortcode class * @var $this WPBakeryShortCode_VC_Gitem_Animated_Block */ $css = $animation = $animation_attr = ''; extract(shortcode_atts(array('css' => '', 'animation' => ''), $atts)); $css_style = ''; $css_class = 'vc_gitem-animated-block' . vc_shortcode_custom_css_class($css, ' '); if (!empty($animation)) { $css_class .= ' vc_gitem-animate vc_gitem-animate-' . $animation; $animation_attr .= ' data-vc-animation="' . esc_attr($animation) . '"'; } elseif ('vc_gitem_preview' !== vc_request_param('action')) { $content = preg_replace('/(?<=\\[)(vc_gitem_zone_b\\b)/', '$1 render="no"', $content); } ?> <div class="<?php echo esc_attr($css_class); ?> "<?php echo $animation_attr; echo empty($css_style) ? '' : ' style="' . esc_attr($css_style) . '"'; ?> ><?php echo do_shortcode($content); ?> </div><?php echo $this->endBlockComment($this->getShortcode());