protected function maybeShiftAttachment() {

		if ( ! in_the_loop() || 'attachment' !== get_post_type() ) {
			return;
		}

		if ( in_array( $this->name, [ 'entry', 'post', 'entry/archive', 'entry/single' ] ) ) {

			remove_filter( 'the_content', 'prepend_attachment' );

		} elseif ( 'embed' === $this->name ) {

			remove_filter( 'the_content',       'prepend_attachment'          );
			remove_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' );
		}
	}
protected function maybeShiftAttachment() {

		if ( ! in_the_loop() || 'attachment' !== get_post_type() ) {
			return;
		}

		if ( in_array( $this->name, [ 'entry', 'post', 'entry/archive', 'entry/single' ] ) ) {

			remove_filter( 'the_content', 'prepend_attachment' );

		} elseif ( 'embed' === $this->name ) {

			remove_filter( 'the_content',       'prepend_attachment'          );
			remove_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' );
		}
	}
protected function maybeShiftAttachment ( ) { if ( ! in_the_loop ( ) || 'attachment' !== get_post_type ( ) ) { return ; } if ( in_array ( $ this -> name , [ 'entry' , 'post' , 'entry/archive' , 'entry/single' ] ) ) { remove_filter ( 'the_content' , 'prepend_attachment' ) ; } elseif ( 'embed' === $ this -> name ) { remove_filter ( 'the_content' , 'prepend_attachment' ) ; remove_filter ( 'the_excerpt_embed' , 'wp_embed_excerpt_attachment' ) ; } }
Removes core WP's `prepend_attachment` filter whenever a theme is
building custom attachment templates. We'll assume that the theme
author will handle the appropriate output in the template itself.

@since  5.0.0
@access protected
@return void
Removes core WP s prepend_attachment filter whenever a theme is building custom attachment templates . We ll assume that the theme author will handle the appropriate output in the template itself .