: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$presenters = \array_merge( $presenters, $this->open_graph_error_presenters );
return \array_merge( $presenters, $this->closing_presenters );
$presenters = $this->get_all_presenters();
if ( \in_array( $page_type, [ 'Static_Home_Page', 'Home_Page' ], true ) ) {
$presenters = \array_merge( $presenters, $this->webmaster_verification_presenters );
// Filter out the presenters only needed for singular pages on non-singular pages.
if ( ! \in_array( $page_type, [ 'Post_Type', 'Static_Home_Page' ], true ) ) {
$presenters = \array_diff( $presenters, $this->singular_presenters );
// Filter out `twitter:data` presenters for static home pages.
if ( $page_type === 'Static_Home_Page' ) {
$presenters = \array_diff( $presenters, $this->slack_presenters );
* Returns a list of all available presenters based on settings.
* @return string[] The presenters.
private function get_all_presenters() {
$presenters = \array_merge( $this->base_presenters, $this->indexing_directive_presenters );
if ( $this->options->get( 'opengraph' ) === true ) {
$presenters = \array_merge( $presenters, $this->open_graph_presenters );
if ( $this->options->get( 'twitter' ) === true && \apply_filters( 'wpseo_output_twitter_card', true ) !== false ) {
$presenters = \array_merge( $presenters, $this->twitter_card_presenters );
if ( $this->options->get( 'enable_enhanced_slack_sharing' ) === true && \apply_filters( 'wpseo_output_enhanced_slack_data', true ) !== false ) {
$presenters = \array_merge( $presenters, $this->slack_presenters );
return \array_merge( $presenters, $this->closing_presenters );
* Whether the title presenter should be removed.
* @return bool True when the title presenter should be removed, false otherwise.
public function should_title_presenter_be_removed() {
return ! \get_theme_support( 'title-tag' ) && ! $this->options->get( 'forcerewritetitle', false );
* Checks if the Title presenter needs to be removed.
* @param string[] $presenters The presenters.
* @return string[] The presenters.
private function maybe_remove_title_presenter( $presenters ) {
// Do not remove the title if we're on a REST request.
if ( $this->request->is_rest_request() ) {
// Remove the title presenter if the theme is hardcoded to output a title tag so we don't have two title tags.
if ( $this->should_title_presenter_be_removed() ) {
$presenters = \array_diff( $presenters, [ 'Title' ] );