Upgarded to 4.17.4
This commit is contained in:
@ -77,7 +77,6 @@ class ET_GB_Block_Layout {
|
||||
|
||||
// Block rendering on frontend
|
||||
add_filter( 'render_block', array( $this, 'render_block' ), 100, 2 );
|
||||
add_filter( 'get_the_excerpt', array( $this, 'get_the_post_excerpt' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,137 +163,104 @@ class ET_GB_Block_Layout {
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter rendered blocks on FE.
|
||||
* Filter rendered Divi - Layout block on FE.
|
||||
*
|
||||
* @since 4.1.0
|
||||
* @since 4.10.0 Filter core/post-excerpt rendered output.
|
||||
* @since 4.14.5 Move other blocks. {@see feature/gutenberg/blocks}.
|
||||
* @since 4.14.8 Add support for WP Editor.
|
||||
*
|
||||
* @param string $block_content Saved & serialized block data.
|
||||
* @param array $block Block info.
|
||||
*/
|
||||
public function render_block( $block_content, $block ) {
|
||||
// Core - Post Excerpt block.
|
||||
if ( 'core/post-excerpt' === $block['blockName'] ) {
|
||||
return $this->get_rendered_post_excerpt( $block_content, true );
|
||||
}
|
||||
|
||||
// Divi - Layout block.
|
||||
if ( 'divi/layout' === $block['blockName'] ) {
|
||||
global $et_is_layout_block;
|
||||
|
||||
// Set flag.
|
||||
$et_is_layout_block = true;
|
||||
|
||||
// Render block content's shortcode. Block content actually can be rendered without this
|
||||
// method and only depending to WordPress' `do_shortcode` hooked into `the_content`. However
|
||||
// layout block need to set global for detecting that shortcode is rendered inside layout
|
||||
// block hence the early shortcode rendering between global variables.
|
||||
$block_content = do_shortcode( $block_content );
|
||||
|
||||
// Reset flag.
|
||||
$et_is_layout_block = false;
|
||||
|
||||
if ( 'divi/layout' !== $block['blockName'] ) {
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
return $block_content;
|
||||
}
|
||||
global $et_is_layout_block, $et_layout_block_info;
|
||||
|
||||
/**
|
||||
* Filter post excerpt of REST API request.
|
||||
*
|
||||
* @since 4.9.10
|
||||
* @since 4.10.0 Only filter post excerpt rendered from REST API request. This API request
|
||||
* is being used by Block Editor.
|
||||
*
|
||||
* @param string $post_excerpt Current post excerpt rendered.
|
||||
*
|
||||
* @return string Modified post excerpt.
|
||||
*/
|
||||
public function get_the_post_excerpt( $post_excerpt ) {
|
||||
// Bail early if current request is not REST API request.
|
||||
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) {
|
||||
return $post_excerpt;
|
||||
// Get WP Editor template data to determine whether current Divi Layout block is
|
||||
// rendered inside WP Editor template or not.
|
||||
$template = $this->get_wp_editor_template_on_render();
|
||||
$template_id = isset( $template->wp_id ) ? (int) $template->wp_id : 0;
|
||||
$block_to_render = class_exists( 'WP_Block_Supports' ) && ! empty( WP_Block_Supports::$block_to_render ) ? WP_Block_Supports::$block_to_render : array();
|
||||
|
||||
// Set flag.
|
||||
$et_is_layout_block = true;
|
||||
$et_layout_block_info = array(
|
||||
'block' => $block,
|
||||
'block_to_render' => $block_to_render,
|
||||
'template' => $template,
|
||||
);
|
||||
|
||||
// Start - Divi Layout block inside WP Editor Template or Template Part.
|
||||
if ( ! empty( $template ) && $template_id > 0 ) {
|
||||
ET_Builder_Element::begin_wp_editor_template( $template_id );
|
||||
}
|
||||
|
||||
return $this->get_rendered_post_excerpt( $post_excerpt );
|
||||
}
|
||||
// Render - Divi Layout block inside Post Content/Template/Template Part.
|
||||
// Render block content's shortcode. Block content actually can be rendered without this
|
||||
// method and only depending to WordPress' `do_shortcode` hooked into `the_content`. However
|
||||
// layout block need to set global for detecting that shortcode is rendered inside layout
|
||||
// block hence the early shortcode rendering between global variables.
|
||||
$block_content = do_shortcode( $block_content );
|
||||
|
||||
/**
|
||||
* Get rendered post excerpt built with builder. Always return rendered $post_excerpt
|
||||
* because it's already wrapped with Post Excerpt block wrapper.
|
||||
*
|
||||
* @since 4.10.0
|
||||
*
|
||||
* @param string $post_excerpt Current rendered post excerpt.
|
||||
* @param boolean $is_wrapped Whether the post excerpt is wrapped or not.
|
||||
*
|
||||
* @return string Old or new rendered post excerpt.
|
||||
*/
|
||||
public function get_rendered_post_excerpt( $post_excerpt, $is_wrapped = false ) {
|
||||
// Bail early if no global post. Need to get the post here due to some issues with
|
||||
// 3rd party plugins regarding missing 2nd arg on the `get_the_excerpt` filter.
|
||||
$post = get_post();
|
||||
if ( empty( $post ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
// End - Divi Layout block inside WP Editor Template or Template Part.
|
||||
if ( ! empty( $template ) && $template_id > 0 ) {
|
||||
// 1. Append builder layout and content wrappers.
|
||||
$block_content = et_builder_get_layout_opening_wrapper() . $block_content . et_builder_get_layout_closing_wrapper();
|
||||
|
||||
if ( ! empty( $post->post_excerpt ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
/** This filter is documented in core.php */
|
||||
$wrap = apply_filters( 'et_builder_add_outer_content_wrap', true );
|
||||
|
||||
// Bail early if Builder framework is not loaded. There are some cases where 3rd
|
||||
// party plugins run scan without visiting theme functions file.
|
||||
if ( ! function_exists( 'et_builder_load_framework' ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
|
||||
if ( ! et_pb_is_pagebuilder_used( $post->ID ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
|
||||
static $et_rendered_post_excerpt = array();
|
||||
|
||||
// Bail early if current post is already processed.
|
||||
if ( isset( $et_rendered_post_excerpt[ $post->ID ] ) ) {
|
||||
return $et_rendered_post_excerpt[ $post->ID ];
|
||||
}
|
||||
|
||||
// 1. Ensure all the ET shortcode are registered.
|
||||
if ( ! did_action( 'et_builder_ready' ) ) {
|
||||
// When the `get_the_excerpt` filter is called by Query Loop block on the FE,
|
||||
// the `ET_Builder_Element` class is loaded properly but no ET shortcode is
|
||||
// registered yet. In this case, we can call `et_builder_init_global_settings`
|
||||
// & `et_builder_add_main_elements` methods directly. However, this class is not
|
||||
// loaded on the Block Editor, so we have to load all related files manually
|
||||
// before we can call those methods to register the shortcode.
|
||||
if ( ! class_exists( 'ET_Builder_Element' ) ) {
|
||||
require_once ET_BUILDER_DIR . 'class-et-builder-value.php';
|
||||
require_once ET_BUILDER_DIR . 'class-et-builder-element.php';
|
||||
require_once ET_BUILDER_DIR . 'ab-testing.php';
|
||||
if ( $wrap ) {
|
||||
$block_content = et_builder_get_builder_content_opening_wrapper() . $block_content . et_builder_get_builder_content_closing_wrapper();
|
||||
}
|
||||
|
||||
et_builder_init_global_settings();
|
||||
et_builder_add_main_elements();
|
||||
et_builder_settings_init();
|
||||
// 2. Pass styles to page resource which will handle their output.
|
||||
$post_id = is_singular() ? ET_Post_Stack::get_main_post_id() : $template_id;
|
||||
$result = ET_Builder_Element::setup_advanced_styles_manager( $post_id );
|
||||
|
||||
$advanced_styles_manager = $result['manager'];
|
||||
if ( isset( $result['deferred'] ) ) {
|
||||
$deferred_styles_manager = $result['deferred'];
|
||||
}
|
||||
|
||||
if ( ET_Builder_Element::$forced_inline_styles || ! $advanced_styles_manager->has_file() || $advanced_styles_manager->forced_inline ) {
|
||||
/** This filter is documented in frontend-builder/theme-builder/frontend.php */
|
||||
$is_critical_enabled = apply_filters( 'et_builder_critical_css_enabled', false );
|
||||
|
||||
$critical = $is_critical_enabled ? ET_Builder_Element::get_style( false, $template_id, true ) . ET_Builder_Element::get_style( true, $template_id, true ) : array();
|
||||
$styles = ET_Builder_Element::get_style( false, $template_id ) . ET_Builder_Element::get_style( true, $template_id );
|
||||
|
||||
if ( empty( $critical ) ) {
|
||||
// No critical styles defined, just enqueue everything as usual.
|
||||
if ( ! empty( $styles ) ) {
|
||||
if ( isset( $deferred_styles_manager ) ) {
|
||||
$deferred_styles_manager->set_data( $styles, 40 );
|
||||
} else {
|
||||
$advanced_styles_manager->set_data( $styles, 40 );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$advanced_styles_manager->set_data( $critical, 40 );
|
||||
if ( ! empty( $styles ) ) {
|
||||
// Defer everything else.
|
||||
$deferred_styles_manager->set_data( $styles, 40 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ET_Builder_Element::end_wp_editor_template();
|
||||
}
|
||||
|
||||
// 2. Generate Builder post excerpt.
|
||||
// WordPress post excerpt length comes from `excerpt_length` filter. And, it's
|
||||
// words based length, not characters based length.
|
||||
$excerpt_length = apply_filters( 'excerpt_length', 55 );
|
||||
$new_post_excerpt = et_core_intentionally_unescaped( wpautop( et_delete_post_first_video( truncate_post( $excerpt_length, false, $post, true, true ) ) ), 'html' );
|
||||
// Reset flag.
|
||||
$et_is_layout_block = false;
|
||||
$et_layout_block_info = false;
|
||||
|
||||
// 3. Ensure to return the block wrapper if the $post_excerpt is already wrapped.
|
||||
if ( $is_wrapped ) {
|
||||
$wrapper = '/(<p class="wp-block-post-excerpt__excerpt">)(.*?)(<a|<\/p>)/';
|
||||
$new_post_excerpt = wp_strip_all_tags( $new_post_excerpt );
|
||||
$new_post_excerpt = preg_replace( $wrapper, "$1{$new_post_excerpt}$3", $post_excerpt );
|
||||
}
|
||||
|
||||
$et_rendered_post_excerpt[ $post->ID ] = $new_post_excerpt;
|
||||
|
||||
return $new_post_excerpt;
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -664,6 +630,105 @@ class ET_GB_Block_Layout {
|
||||
[/et_pb_row]
|
||||
[/et_pb_section]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current active WP Editor template on block render.
|
||||
*
|
||||
* @since 4.14.8
|
||||
*
|
||||
* @return WP_Block_Template|null Template. Return null if it doesn't exist.
|
||||
*/
|
||||
public function get_wp_editor_template_on_render() {
|
||||
global $post;
|
||||
|
||||
static $templates_result = null;
|
||||
|
||||
// Bail early if `get_block_template` function doesn't exist because we need it to
|
||||
// get template data. This function is introduced on WP 5.8 along with Template and
|
||||
// Template Parts editors.
|
||||
if ( ! function_exists( 'get_block_template' ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Bail early if current post is not singular.
|
||||
if ( ! is_singular() ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Bail early if TB override current layouts.
|
||||
if ( ! empty( et_theme_builder_get_template_layouts() ) ) {
|
||||
$override_header = et_theme_builder_overrides_layout( ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE );
|
||||
$override_body = et_theme_builder_overrides_layout( ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE );
|
||||
$override_footer = et_theme_builder_overrides_layout( ET_THEME_BUILDER_FOOTER_LAYOUT_POST_TYPE );
|
||||
|
||||
if ( $override_header || $override_body || $override_footer ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Get WP Editor template data to determine whether current Divi Layout block is
|
||||
// rendered inside WP Editor template or not.
|
||||
$block_to_render = class_exists( 'WP_Block_Supports' ) && ! empty( WP_Block_Supports::$block_to_render ) ? WP_Block_Supports::$block_to_render : array();
|
||||
$block_to_render_name = et_()->array_get( $block_to_render, 'blockName', '' );
|
||||
|
||||
// Bail early if block to render name is post content. Divi Layout block inside post
|
||||
// content will be rendered normally.
|
||||
if ( 'core/post-content' === $block_to_render_name ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 1. Generate template type and slug.
|
||||
$template_type = '';
|
||||
$template_slug = '';
|
||||
|
||||
if ( 'core/template-part' === $block_to_render_name ) {
|
||||
$template_type = ET_WP_EDITOR_TEMPLATE_PART_POST_TYPE;
|
||||
$template_slug = et_()->array_get( $block_to_render, array( 'attrs', 'slug' ), '' );
|
||||
} else {
|
||||
$template_type = ET_WP_EDITOR_TEMPLATE_POST_TYPE;
|
||||
$template_slug = ! empty( $post->page_template ) ? $post->page_template : $this->get_default_template_slug();
|
||||
}
|
||||
|
||||
$template_type_slug = "{$template_type}-{$template_slug}";
|
||||
|
||||
// Bail early if current template type + slug is already processed.
|
||||
if ( ! empty( $templates_result[ $template_type_slug ] ) ) {
|
||||
return $templates_result[ $template_type_slug ];
|
||||
}
|
||||
|
||||
// 2. Get block template data based on post slug and post type.
|
||||
$template = ! empty( $template_type ) && ! empty( $template_slug ) ? get_block_template( get_stylesheet() . '//' . $template_slug, $template_type ) : null;
|
||||
|
||||
// 3. Save the result to be used later.
|
||||
$templates_result[ $template_type_slug ] = $template;
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default template slug.
|
||||
*
|
||||
* @since 4.14.8
|
||||
*
|
||||
* @return string Template type.
|
||||
*/
|
||||
public function get_default_template_slug() {
|
||||
// Bail early if current page isn't singular. At this moment, Divi Layout block only
|
||||
// support singular page. Once we solved Divi Layout block issue on Site Editor, the
|
||||
// template type check below will be updated.
|
||||
if ( ! is_singular() ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// At this moment, only single.html and page.html are editable.
|
||||
if ( is_page() ) {
|
||||
return 'page';
|
||||
} elseif ( is_single() ) {
|
||||
return 'single';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize ET_GB_Block_Layout
|
||||
|
201
includes/builder/feature/gutenberg/blocks/PostExcerpt.php
Normal file
201
includes/builder/feature/gutenberg/blocks/PostExcerpt.php
Normal file
@ -0,0 +1,201 @@
|
||||
<?php
|
||||
/**
|
||||
* ET_GB_Block_Post_Excerpt class file.
|
||||
*
|
||||
* @class ET_GB_Block_Post_Excerpt
|
||||
* @package Builder
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to handle Core - Post Excerpt block integration.
|
||||
*/
|
||||
class ET_GB_Block_Post_Excerpt {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @var ET_GB_Block_Post_Excerpt
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( ! et_core_is_gutenberg_active() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->register_hooks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get class instance.
|
||||
*
|
||||
* @since 4.14.5
|
||||
*
|
||||
* @return ET_GB_Block_Post_Excerpt Class instance.
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( null === self::$_instance ) {
|
||||
self::$_instance = new self();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks
|
||||
*
|
||||
* @since 4.14.5
|
||||
*/
|
||||
public function register_hooks() {
|
||||
add_filter( 'render_block_core/post-excerpt', array( $this, 'render_block' ), 10, 2 );
|
||||
add_filter( 'get_the_excerpt', array( $this, 'get_the_post_excerpt' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter rendered Core - Post Excerpt block on FE.
|
||||
*
|
||||
* @since 4.14.5
|
||||
*
|
||||
* @param string $block_content Saved & serialized block data.
|
||||
* @param array $parsed_block Block info.
|
||||
*
|
||||
* @return string Modified block post excerpt.
|
||||
*/
|
||||
public function render_block( $block_content, $parsed_block ) {
|
||||
$attributes = ! empty( $parsed_block['attrs'] ) ? $parsed_block['attrs'] : array();
|
||||
|
||||
return $this->get_rendered_post_excerpt( $block_content, true, $attributes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter post excerpt of REST API request.
|
||||
*
|
||||
* Only filter post excerpt rendered from REST API request. This API request is being
|
||||
* used by Block Editor.
|
||||
*
|
||||
* @since 4.14.5
|
||||
*
|
||||
* @param string $post_excerpt Current post excerpt rendered.
|
||||
*
|
||||
* @return string Modified post excerpt.
|
||||
*/
|
||||
public function get_the_post_excerpt( $post_excerpt ) {
|
||||
// Bail early if current request is not REST API request.
|
||||
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
|
||||
return $this->get_rendered_post_excerpt( $post_excerpt );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rendered post excerpt built with builder. Always return rendered $block_excerpt
|
||||
* because it's already wrapped with Post Excerpt block wrapper.
|
||||
*
|
||||
* @since 4.14.5
|
||||
*
|
||||
* @param string $block_excerpt Current rendered post excerpt.
|
||||
* @param boolean $is_wrapped Whether the post excerpt is wrapped or not.
|
||||
* @param array $attributes Block attributes values.
|
||||
*
|
||||
* @return string Old or new rendered post excerpt.
|
||||
*/
|
||||
public function get_rendered_post_excerpt( $block_excerpt, $is_wrapped = false, $attributes = array() ) {
|
||||
// Bail early if no global post. Need to get the post here due to some issues with
|
||||
// 3rd party plugins regarding missing 2nd arg on the `get_the_excerpt` filter.
|
||||
$post_id = ! empty( $attributes['postId'] ) ? (int) $attributes['postId'] : 0;
|
||||
$post = $post_id ? get_post( $post_id ) : get_post();
|
||||
if ( empty( $post ) ) {
|
||||
return $block_excerpt;
|
||||
}
|
||||
|
||||
if ( ! empty( $post->post_excerpt ) ) {
|
||||
return $block_excerpt;
|
||||
}
|
||||
|
||||
// Bail early if Builder framework is not loaded. There are some cases where 3rd
|
||||
// party plugins run scan without visiting theme functions file.
|
||||
if ( ! function_exists( 'et_builder_load_framework' ) ) {
|
||||
return $block_excerpt;
|
||||
}
|
||||
|
||||
if ( ! et_pb_is_pagebuilder_used( $post->ID ) ) {
|
||||
return $block_excerpt;
|
||||
}
|
||||
|
||||
static $et_rendered_post_excerpt = array();
|
||||
|
||||
// Bail early if current post is already processed.
|
||||
if ( isset( $et_rendered_post_excerpt[ $post->ID ] ) ) {
|
||||
return $et_rendered_post_excerpt[ $post->ID ];
|
||||
}
|
||||
|
||||
// 1. Ensure all the ET shortcode are registered.
|
||||
if ( ! did_action( 'et_builder_ready' ) ) {
|
||||
// When the `get_the_excerpt` filter is called by Query Loop block on the FE,
|
||||
// the `ET_Builder_Element` class is loaded properly but no ET shortcode is
|
||||
// registered yet. In this case, we can call `et_builder_init_global_settings`
|
||||
// & `et_builder_add_main_elements` methods directly. However, this class is not
|
||||
// loaded on the Block Editor, so we have to load all related files manually
|
||||
// before we can call those methods to register the shortcode.
|
||||
if ( ! class_exists( 'ET_Builder_Element' ) ) {
|
||||
require_once ET_BUILDER_DIR . 'class-et-builder-value.php';
|
||||
require_once ET_BUILDER_DIR . 'class-et-builder-element.php';
|
||||
require_once ET_BUILDER_DIR . 'ab-testing.php';
|
||||
}
|
||||
|
||||
et_builder_init_global_settings();
|
||||
et_builder_add_main_elements();
|
||||
et_builder_settings_init();
|
||||
}
|
||||
|
||||
// 2. Generate Builder post excerpt.
|
||||
// WordPress post excerpt length comes from `excerpt_length` filter. And, it's
|
||||
// words based length, not characters based length.
|
||||
$excerpt_length = apply_filters( 'excerpt_length', 55 );
|
||||
$new_post_excerpt = et_core_intentionally_unescaped( wpautop( et_delete_post_first_video( truncate_post( $excerpt_length, false, $post, true, true ) ) ), 'html' );
|
||||
|
||||
// 3. Ensure to return the block wrapper if the $block_excerpt is already wrapped.
|
||||
if ( $is_wrapped && ! empty( $new_post_excerpt ) ) {
|
||||
$new_post_excerpt = wp_strip_all_tags( $new_post_excerpt );
|
||||
|
||||
// If generated block excerpt is not empty, we just need to replace the excerpt
|
||||
// text with the new one. Otherwise, we have to rebuilt the block excerpt.
|
||||
if ( ! empty( $block_excerpt ) ) {
|
||||
$wrapper = '/(<p class="wp-block-post-excerpt__excerpt">)(.*?)(<a|<\/p>)/';
|
||||
$new_post_excerpt = preg_replace( $wrapper, "$1{$new_post_excerpt}$3", $block_excerpt );
|
||||
} else {
|
||||
// 3.a. More Text.
|
||||
$more_text = ! empty( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $post->ID ) ) . '">' . esc_html( $attributes['moreText'] ) . '</a>' : '';
|
||||
|
||||
// 3.b. Text Align Class.
|
||||
$classes = ! empty( $attributes['textAlign'] ) ? 'has-text-align-' . esc_attr( $attributes['textAlign'] ) : '';
|
||||
$wrapper_attrs = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
||||
|
||||
// 3.c. Post Excerpt Content.
|
||||
$content = '<p class="wp-block-post-excerpt__excerpt">' . $new_post_excerpt;
|
||||
$show_more_on_new_line = et_()->array_get( $attributes, 'showMoreOnNewLine', true );
|
||||
if ( $show_more_on_new_line && ! empty( $more_text ) ) {
|
||||
$content .= '</p><p class="wp-block-post-excerpt__more-text">' . $more_text . '</p>';
|
||||
} else {
|
||||
$content .= $more_text . '</p>';
|
||||
}
|
||||
|
||||
$new_post_excerpt = sprintf( '<div %1$s>%2$s</div>', $wrapper_attrs, $content );
|
||||
}
|
||||
}
|
||||
|
||||
$et_rendered_post_excerpt[ $post->ID ] = $new_post_excerpt;
|
||||
|
||||
return $new_post_excerpt;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize ET_GB_Block_Post_Excerpt.
|
||||
ET_GB_Block_Post_Excerpt::instance();
|
Reference in New Issue
Block a user