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-admin-help-panel.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\Admin
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Generates the HTML for an inline Help Button and Panel.
[8] Fix | Delete
*/
[9] Fix | Delete
class WPSEO_Admin_Help_Panel {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Unique identifier of the element the inline help refers to, used as an identifier in the html.
[13] Fix | Delete
*
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
private $id;
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* The Help Button text. Needs a properly escaped string.
[20] Fix | Delete
*
[21] Fix | Delete
* @var string
[22] Fix | Delete
*/
[23] Fix | Delete
private $help_button_text;
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* The Help Panel content. Needs a properly escaped string (might contain HTML).
[27] Fix | Delete
*
[28] Fix | Delete
* @var string
[29] Fix | Delete
*/
[30] Fix | Delete
private $help_content;
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* Optional Whether to print out a container div element for the Help Panel, used for styling.
[34] Fix | Delete
*
[35] Fix | Delete
* @var string
[36] Fix | Delete
*/
[37] Fix | Delete
private $wrapper;
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Constructor.
[41] Fix | Delete
*
[42] Fix | Delete
* @param string $id Unique identifier of the element the inline help refers to, used as
[43] Fix | Delete
* an identifier in the html.
[44] Fix | Delete
* @param string $help_button_text The Help Button text. Needs a properly escaped string.
[45] Fix | Delete
* @param string $help_content The Help Panel content. Needs a properly escaped string (might contain HTML).
[46] Fix | Delete
* @param string $wrapper Optional Whether to print out a container div element for the Help Panel,
[47] Fix | Delete
* used for styling.
[48] Fix | Delete
* Pass a `has-wrapper` value to print out the container. Default: no container.
[49] Fix | Delete
*/
[50] Fix | Delete
public function __construct( $id, $help_button_text, $help_content, $wrapper = '' ) {
[51] Fix | Delete
$this->id = $id;
[52] Fix | Delete
$this->help_button_text = $help_button_text;
[53] Fix | Delete
$this->help_content = $help_content;
[54] Fix | Delete
$this->wrapper = $wrapper;
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* Returns the html for the Help Button.
[59] Fix | Delete
*
[60] Fix | Delete
* @return string
[61] Fix | Delete
*/
[62] Fix | Delete
public function get_button_html() {
[63] Fix | Delete
[64] Fix | Delete
if ( ! $this->id || ! $this->help_button_text || ! $this->help_content ) {
[65] Fix | Delete
return '';
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
return sprintf(
[69] Fix | Delete
' <button type="button" class="yoast_help yoast-help-button dashicons" id="%1$s-help-toggle" aria-expanded="false" aria-controls="%1$s-help"><span class="yoast-help-icon" aria-hidden="true"></span><span class="screen-reader-text">%2$s</span></button>',
[70] Fix | Delete
esc_attr( $this->id ),
[71] Fix | Delete
$this->help_button_text
[72] Fix | Delete
);
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Returns the html for the Help Panel.
[77] Fix | Delete
*
[78] Fix | Delete
* @return string
[79] Fix | Delete
*/
[80] Fix | Delete
public function get_panel_html() {
[81] Fix | Delete
[82] Fix | Delete
if ( ! $this->id || ! $this->help_button_text || ! $this->help_content ) {
[83] Fix | Delete
return '';
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
$wrapper_start = '';
[87] Fix | Delete
$wrapper_end = '';
[88] Fix | Delete
[89] Fix | Delete
if ( $this->wrapper === 'has-wrapper' ) {
[90] Fix | Delete
$wrapper_start = '<div class="yoast-seo-help-container">';
[91] Fix | Delete
$wrapper_end = '</div>';
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
return sprintf(
[95] Fix | Delete
'%1$s<p id="%2$s-help" class="yoast-help-panel">%3$s</p>%4$s',
[96] Fix | Delete
$wrapper_start,
[97] Fix | Delete
esc_attr( $this->id ),
[98] Fix | Delete
$this->help_content,
[99] Fix | Delete
$wrapper_end
[100] Fix | Delete
);
[101] Fix | Delete
}
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function