diff --git a/includes/class-newspack-blocks.php b/includes/class-newspack-blocks.php index 22adff59c..ef7f72d56 100644 --- a/includes/class-newspack-blocks.php +++ b/includes/class-newspack-blocks.php @@ -14,9 +14,11 @@ class Newspack_Blocks { * Script handles. */ const SCRIPT_HANDLES = [ - 'streamlined' => 'newspack-blocks-donate-streamlined', - 'frequency-based' => 'newspack-blocks-donate-frequency-based', - 'tiers-based' => 'newspack-blocks-donate-tiers-based', + 'modal-checkout' => 'newspack-blocks-donate-modal-checkout', + 'modal-checkout-block' => 'newspack-blocks-donate-modal-checkout-block', + 'streamlined' => 'newspack-blocks-donate-streamlined', + 'frequency-based' => 'newspack-blocks-donate-frequency-based', + 'tiers-based' => 'newspack-blocks-donate-tiers-based', ]; /** @@ -73,7 +75,7 @@ public static function init() { } /** - * Modify the Donate block script to allow it as an "AMP Plus" script. + * Modify the Donate block scripts to allow it as an "AMP Plus" script. * * @param string $tag HTML of the script tag. * @param string $handle The script handle. @@ -365,9 +367,6 @@ public static function enqueue_view_assets( $type ) { NEWSPACK_BLOCKS__VERSION ); } - if ( static::is_amp() ) { - return; - } $script_data = static::script_enqueue_helper( NEWSPACK_BLOCKS__BLOCKS_DIRECTORY . $type . '/view.js' ); if ( $script_data ) { wp_enqueue_script( @@ -1044,24 +1043,37 @@ public static function filter_excerpt( $attributes ) { } self::$newspack_blocks_excerpt_closure = function( $text = '', $post = null ) use ( $attributes ) { - $post = get_post( $post ); - $text = $post->post_excerpt; - $raw_excerpt = $text; - - if ( empty( $text ) ) { - $text = get_the_content( '', false, $post ); - $text = strip_shortcodes( $text ); - $text = excerpt_remove_blocks( $text ); + // If we have a manually entered excerpt, use that and allow some tags. + if ( ! empty( $post->post_excerpt ) ) { + $excerpt = $post->post_excerpt; + $allowed_tags = ',,,,,