Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../wp-conte.../plugins/wordpres.../admin
File: class-option-tabs-formatter.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\Admin\Options\Tabs
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
use Yoast\WP\SEO\Presenters\Admin\Beta_Badge_Presenter;
[7] Fix | Delete
use Yoast\WP\SEO\Presenters\Admin\Premium_Badge_Presenter;
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Class WPSEO_Option_Tabs_Formatter.
[11] Fix | Delete
*/
[12] Fix | Delete
class WPSEO_Option_Tabs_Formatter {
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Retrieves the path to the view of the tab.
[16] Fix | Delete
*
[17] Fix | Delete
* @param WPSEO_Option_Tabs $option_tabs Option Tabs to get base from.
[18] Fix | Delete
* @param WPSEO_Option_Tab $tab Tab to get name from.
[19] Fix | Delete
*
[20] Fix | Delete
* @return string
[21] Fix | Delete
*/
[22] Fix | Delete
public function get_tab_view( WPSEO_Option_Tabs $option_tabs, WPSEO_Option_Tab $tab ) {
[23] Fix | Delete
return WPSEO_PATH . 'admin/views/tabs/' . $option_tabs->get_base() . '/' . $tab->get_name() . '.php';
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* Outputs the option tabs.
[28] Fix | Delete
*
[29] Fix | Delete
* @param WPSEO_Option_Tabs $option_tabs Option Tabs to get tabs from.
[30] Fix | Delete
*
[31] Fix | Delete
* @return void
[32] Fix | Delete
*/
[33] Fix | Delete
public function run( WPSEO_Option_Tabs $option_tabs ) {
[34] Fix | Delete
[35] Fix | Delete
echo '<h2 class="nav-tab-wrapper" id="wpseo-tabs">';
[36] Fix | Delete
foreach ( $option_tabs->get_tabs() as $tab ) {
[37] Fix | Delete
$label = esc_html( $tab->get_label() );
[38] Fix | Delete
[39] Fix | Delete
if ( $tab->is_beta() ) {
[40] Fix | Delete
$label = '<span style="margin-right:4px;">' . $label . '</span>' . new Beta_Badge_Presenter( $tab->get_name() );
[41] Fix | Delete
}
[42] Fix | Delete
elseif ( $tab->is_premium() ) {
[43] Fix | Delete
$label = '<span style="margin-right:4px;">' . $label . '</span>' . new Premium_Badge_Presenter( $tab->get_name() );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
printf(
[47] Fix | Delete
'<a class="nav-tab" id="%1$s" href="%2$s">%3$s</a>',
[48] Fix | Delete
esc_attr( $tab->get_name() . '-tab' ),
[49] Fix | Delete
esc_url( '#top#' . $tab->get_name() ),
[50] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: we do this on purpose
[51] Fix | Delete
$label
[52] Fix | Delete
);
[53] Fix | Delete
}
[54] Fix | Delete
echo '</h2>';
[55] Fix | Delete
[56] Fix | Delete
foreach ( $option_tabs->get_tabs() as $tab ) {
[57] Fix | Delete
$identifier = $tab->get_name();
[58] Fix | Delete
[59] Fix | Delete
$class = 'wpseotab ' . ( $tab->has_save_button() ? 'save' : 'nosave' );
[60] Fix | Delete
printf( '<div id="%1$s" class="%2$s">', esc_attr( $identifier ), esc_attr( $class ) );
[61] Fix | Delete
[62] Fix | Delete
$tab_filter_name = sprintf( '%s_%s', $option_tabs->get_base(), $tab->get_name() );
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Allows to override the content that is display on the specific option tab.
[66] Fix | Delete
*
[67] Fix | Delete
* @internal For internal Yoast SEO use only.
[68] Fix | Delete
*
[69] Fix | Delete
* @param string|null $tab_contents The content that should be displayed for this tab. Leave empty for default behaviour.
[70] Fix | Delete
* @param WPSEO_Option_Tabs $option_tabs The registered option tabs.
[71] Fix | Delete
* @param WPSEO_Option_Tab $tab The tab that is being displayed.
[72] Fix | Delete
*/
[73] Fix | Delete
$option_tab_content = apply_filters( 'wpseo_option_tab-' . $tab_filter_name, null, $option_tabs, $tab );
[74] Fix | Delete
if ( ! empty( $option_tab_content ) ) {
[75] Fix | Delete
echo wp_kses_post( $option_tab_content );
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
if ( empty( $option_tab_content ) ) {
[79] Fix | Delete
// Output the settings view for all tabs.
[80] Fix | Delete
$tab_view = $this->get_tab_view( $option_tabs, $tab );
[81] Fix | Delete
[82] Fix | Delete
if ( is_file( $tab_view ) ) {
[83] Fix | Delete
$yform = Yoast_Form::get_instance();
[84] Fix | Delete
require $tab_view;
[85] Fix | Delete
}
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
echo '</div>';
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function