/** * 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(); } }
/** * 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(); } }