/**
 *  Render preview for grid item
 * @since 4.4
 */
function vc_grid_item_render_preview()
{
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
    $grid_item = new Vc_Grid_Item();
    $grid_item->mapShortcodes();
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-preview.php');
    $vcGridPreview = new Vc_Grid_Item_Preview();
    add_filter('vc_gitem_template_attribute_post_image_background_image_css_value', array($vcGridPreview, 'addCssBackgroundImage'));
    add_filter('vc_gitem_template_attribute_post_image_url_value', array($vcGridPreview, 'addImageUrl'));
    $vcGridPreview->render();
    die;
}
/**
 *  Render preview for grid item
 * @since 4.4
 */
function vc_grid_item_render_preview()
{
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
    $grid_item = new Vc_Grid_Item();
    $grid_item->mapShortcodes();
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-preview.php');
    $vcGridPreview = new Vc_Grid_Item_Preview();
    add_filter('vc_gitem_template_attribute_post_image_background_image_css_value', array($vcGridPreview, 'addCssBackgroundImage'));
    add_filter('vc_gitem_template_attribute_post_image_url_value', array($vcGridPreview, 'addImageUrl'));
    add_filter('vc_gitem_template_attribute_post_image_html', array($vcGridPreview, 'addImage'));
    add_filter('vc_gitem_attribute_featured_image_img', array($vcGridPreview, 'addPlaceholderImage'));
    add_filter('vc_gitem_post_data_get_link_real_link', array($vcGridPreview, 'disableRealContentLink'), 10, 4);
    add_filter('vc_gitem_post_data_get_link_link', array($vcGridPreview, 'disableContentLink'), 10, 3);
    add_filter('vc_gitem_zone_image_block_link', array($vcGridPreview, 'disableGitemZoneLink'));
    $vcGridPreview->render();
    die;
}
示例#3
0
/**
 *  Render preview for grid item
 * @since 4.4
 */
function vc_grid_item_render_preview()
{
    vc_user_access()->checkAdminNonce()->validateDie()->wpAny(array('edit_post', (int) vc_request_param('post_id')))->validateDie()->part('grid_builder')->can()->validateDie();
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
    $grid_item = new Vc_Grid_Item();
    $grid_item->mapShortcodes();
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-preview.php');
    $vcGridPreview = new Vc_Grid_Item_Preview();
    add_filter('vc_gitem_template_attribute_post_image_background_image_css_value', array($vcGridPreview, 'addCssBackgroundImage'));
    add_filter('vc_gitem_template_attribute_post_image_url_value', array($vcGridPreview, 'addImageUrl'));
    add_filter('vc_gitem_template_attribute_post_image_html', array($vcGridPreview, 'addImage'));
    add_filter('vc_gitem_attribute_featured_image_img', array($vcGridPreview, 'addPlaceholderImage'));
    add_filter('vc_gitem_post_data_get_link_real_link', array($vcGridPreview, 'disableRealContentLink'), 10, 4);
    add_filter('vc_gitem_post_data_get_link_link', array($vcGridPreview, 'disableContentLink'), 10, 3);
    add_filter('vc_gitem_zone_image_block_link', array($vcGridPreview, 'disableGitemZoneLink'));
    $vcGridPreview->render();
    die;
}