diff --git a/includes/admin/class-amp-editor-blocks.php b/includes/admin/class-amp-editor-blocks.php index cf484fb0ac3..7e880cea840 100644 --- a/includes/admin/class-amp-editor-blocks.php +++ b/includes/admin/class-amp-editor-blocks.php @@ -43,16 +43,6 @@ public function init() { if ( function_exists( 'gutenberg_init' ) ) { add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) ); add_filter( 'wp_kses_allowed_html', array( $this, 'whitelist_block_atts_in_wp_kses_allowed_html' ), 10, 2 ); - - /* - * Dirty AMP is currently disabled per . - * Note that when not in native/canonical mode, AMP-specific Gutenberg blocks will not be - * registered for use, and so users will not be likely attempting to serve AMP content in - * non-AMP responses. When/if dirty AMP is allowed, the following can be re-enabled: - * - * add_filter( 'the_content', array( $this, 'tally_content_requiring_amp_scripts' ) ); - * add_action( 'wp_print_footer_scripts', array( $this, 'print_dirty_amp_scripts' ) ); - */ } } @@ -155,32 +145,4 @@ public function enqueue_block_editor_assets() { ) ) ) ); } - - /** - * Tally the AMP component scripts that are needed in a dirty AMP document. - * - * @param string $content Content. - * @return string Content (unmodified). - */ - public function tally_content_requiring_amp_scripts( $content ) { - if ( ! is_amp_endpoint() ) { - $pattern = sprintf( '/<(%s)\b.*?>/s', join( '|', $this->amp_blocks ) ); - if ( preg_match_all( $pattern, $content, $matches ) ) { - $this->content_required_amp_scripts = array_merge( - $this->content_required_amp_scripts, - $matches[1] - ); - } - } - return $content; - } - - /** - * Print AMP scripts required for AMP components used in a non-AMP document (dirty AMP). - */ - public function print_dirty_amp_scripts() { - if ( ! is_amp_endpoint() && ! empty( $this->content_required_amp_scripts ) ) { - wp_scripts()->do_items( $this->content_required_amp_scripts ); - } - } } diff --git a/includes/options/class-amp-options-menu.php b/includes/options/class-amp-options-menu.php index 091b5703774..52654ab584e 100644 --- a/includes/options/class-amp-options-menu.php +++ b/includes/options/class-amp-options-menu.php @@ -136,7 +136,7 @@ public function render_theme_support() {
>