add_tab( $tab ); } } /** * Determines whether the passed tab is considered valid. * * @deprecated 12.3 * @codeCoverageIgnore * * @param mixed $tab The potential tab that needs to be validated. * * @return bool Whether or not the tab is valid. */ protected function is_valid_tab( $tab ) { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); if ( $tab instanceof WPSEO_Metabox_Tab && ! $tab instanceof WPSEO_Metabox_Null_Tab ) { return true; } return false; } /** * Outputs the section content if any tab has been added. * * @deprecated 12.3 * @codeCoverageIgnore */ public function display_content() { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); if ( $this->has_sections() ) { $html = '
'; $html .= '
'; $html .= '%4$s'; $html .= '
'; printf( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated. $html, esc_attr( $this->name ), esc_attr( 'wpseo-metabox-tab-' . $this->name ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated. $this->tab_links(), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: This is deprecated. $this->tab_content() ); } } /** * Add a `WPSEO_Metabox_Tab` object to the tabs. * * @deprecated 12.3 * @codeCoverageIgnore * * @param WPSEO_Metabox_Tab $tab Tab to add. */ public function add_tab( WPSEO_Metabox_Tab $tab ) { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); $this->tabs[] = $tab; } /** * Checks if any tabs have been added to the section. * * @deprecated 12.3 * @codeCoverageIgnore * * @return bool */ protected function has_sections() { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); return ! empty( $this->tabs ); } /** * Concatenates all tabs' links into one html string. * * @deprecated 12.3 * @codeCoverageIgnore * * @return string */ private function tab_links() { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); $links = ''; foreach ( $this->tabs as $tab ) { $links .= $tab->link(); } return $links; } /** * Concatenates all tabs' content into one html string. * * @deprecated 12.3 * @codeCoverageIgnore * * @return string */ private function tab_content() { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); $content = ''; foreach ( $this->tabs as $tab ) { $content .= $tab->content(); } return $content; } /** * Gets the name of the tab section. * * @deprecated 12.3 * @codeCoverageIgnore * * @return string The name of the tab section. */ public function get_name() { _deprecated_function( __METHOD__, 'WPSEO 12.3' ); return $this->name; } }