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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../admin
File: class-yoast-form.php
* @param bool $inverse_keys Whether or not the option keys need to be inverted to support older functions.
[1000] Fix | Delete
* @param string $help Inline Help that will be printed out before the visible toggles text.
[1001] Fix | Delete
* @param array $attr Extra attributes to add to the show-hide switch.
[1002] Fix | Delete
*
[1003] Fix | Delete
* @return void
[1004] Fix | Delete
*/
[1005] Fix | Delete
public function show_hide_switch( $variable, $label, $inverse_keys = false, $help = '', $attr = [] ) {
[1006] Fix | Delete
$defaults = [
[1007] Fix | Delete
'disabled' => false,
[1008] Fix | Delete
];
[1009] Fix | Delete
$attr = wp_parse_args( $attr, $defaults );
[1010] Fix | Delete
[1011] Fix | Delete
$on_key = ( $inverse_keys ) ? 'off' : 'on';
[1012] Fix | Delete
$off_key = ( $inverse_keys ) ? 'on' : 'off';
[1013] Fix | Delete
[1014] Fix | Delete
$show_hide_switch = [
[1015] Fix | Delete
$on_key => __( 'On', 'wordpress-seo' ),
[1016] Fix | Delete
$off_key => __( 'Off', 'wordpress-seo' ),
[1017] Fix | Delete
];
[1018] Fix | Delete
[1019] Fix | Delete
$is_disabled = ( isset( $attr['disabled'] ) && $attr['disabled'] );
[1020] Fix | Delete
[1021] Fix | Delete
$this->toggle_switch(
[1022] Fix | Delete
$variable,
[1023] Fix | Delete
$show_hide_switch,
[1024] Fix | Delete
$label,
[1025] Fix | Delete
$help,
[1026] Fix | Delete
[ 'disabled' => $is_disabled ]
[1027] Fix | Delete
);
[1028] Fix | Delete
}
[1029] Fix | Delete
[1030] Fix | Delete
/**
[1031] Fix | Delete
* Retrieves the value for the form field.
[1032] Fix | Delete
*
[1033] Fix | Delete
* @param string $field_name The field name to retrieve the value for.
[1034] Fix | Delete
* @param string|null $default_value The default value, when field has no value.
[1035] Fix | Delete
*
[1036] Fix | Delete
* @return mixed|null The retrieved value.
[1037] Fix | Delete
*/
[1038] Fix | Delete
protected function get_field_value( $field_name, $default_value = null ) {
[1039] Fix | Delete
// On multisite subsites, the Usage tracking feature should always be set to Off.
[1040] Fix | Delete
if ( $this->is_tracking_on_subsite( $field_name ) ) {
[1041] Fix | Delete
return false;
[1042] Fix | Delete
}
[1043] Fix | Delete
[1044] Fix | Delete
return WPSEO_Options::get( $field_name, $default_value );
[1045] Fix | Delete
}
[1046] Fix | Delete
[1047] Fix | Delete
/**
[1048] Fix | Delete
* Checks whether a given control should be disabled.
[1049] Fix | Delete
*
[1050] Fix | Delete
* @param string $variable The variable within the option to check whether its control should be disabled.
[1051] Fix | Delete
*
[1052] Fix | Delete
* @return bool True if control should be disabled, false otherwise.
[1053] Fix | Delete
*/
[1054] Fix | Delete
protected function is_control_disabled( $variable ) {
[1055] Fix | Delete
if ( $this->option_instance === null ) {
[1056] Fix | Delete
return false;
[1057] Fix | Delete
}
[1058] Fix | Delete
[1059] Fix | Delete
// Disable the Usage tracking feature for multisite subsites.
[1060] Fix | Delete
if ( $this->is_tracking_on_subsite( $variable ) ) {
[1061] Fix | Delete
return true;
[1062] Fix | Delete
}
[1063] Fix | Delete
[1064] Fix | Delete
return $this->option_instance->is_disabled( $variable );
[1065] Fix | Delete
}
[1066] Fix | Delete
[1067] Fix | Delete
/**
[1068] Fix | Delete
* Gets the explanation note to print if a given control is disabled.
[1069] Fix | Delete
*
[1070] Fix | Delete
* @param string $variable The variable within the option to print a disabled note for.
[1071] Fix | Delete
* @param string $custom_note An optional custom note to print instead.
[1072] Fix | Delete
*
[1073] Fix | Delete
* @return string Explanation note HTML string, or empty string if no note necessary.
[1074] Fix | Delete
*/
[1075] Fix | Delete
protected function get_disabled_note( $variable, $custom_note = '' ) {
[1076] Fix | Delete
if ( $custom_note === '' && ! $this->is_control_disabled( $variable ) ) {
[1077] Fix | Delete
return '';
[1078] Fix | Delete
}
[1079] Fix | Delete
$disabled_message = esc_html__( 'This feature has been disabled by the network admin.', 'wordpress-seo' );
[1080] Fix | Delete
[1081] Fix | Delete
// The explanation to show when disabling the Usage tracking feature for multisite subsites.
[1082] Fix | Delete
if ( $this->is_tracking_on_subsite( $variable ) ) {
[1083] Fix | Delete
$disabled_message = esc_html__( 'This feature has been disabled since subsites never send tracking data.', 'wordpress-seo' );
[1084] Fix | Delete
}
[1085] Fix | Delete
[1086] Fix | Delete
if ( $custom_note ) {
[1087] Fix | Delete
$disabled_message = esc_html( $custom_note );
[1088] Fix | Delete
}
[1089] Fix | Delete
[1090] Fix | Delete
return '<p class="disabled-note">' . $disabled_message . '</p>';
[1091] Fix | Delete
}
[1092] Fix | Delete
[1093] Fix | Delete
/**
[1094] Fix | Delete
* Determines whether we are dealing with the Usage tracking feature on a multisite subsite.
[1095] Fix | Delete
* This feature requires specific behavior for the toggle switch.
[1096] Fix | Delete
*
[1097] Fix | Delete
* @param string $feature_setting The feature setting.
[1098] Fix | Delete
*
[1099] Fix | Delete
* @return bool True if we are dealing with the Usage tracking feature on a multisite subsite.
[1100] Fix | Delete
*/
[1101] Fix | Delete
protected function is_tracking_on_subsite( $feature_setting ) {
[1102] Fix | Delete
return ( $feature_setting === 'tracking' && ! is_network_admin() && ! is_main_site() );
[1103] Fix | Delete
}
[1104] Fix | Delete
[1105] Fix | Delete
/**
[1106] Fix | Delete
* Returns the disabled attribute HTML.
[1107] Fix | Delete
*
[1108] Fix | Delete
* @param string $variable The variable within the option of the related form element.
[1109] Fix | Delete
* @param array $attr Extra attributes added to the form element.
[1110] Fix | Delete
*
[1111] Fix | Delete
* @return string The disabled attribute HTML.
[1112] Fix | Delete
*/
[1113] Fix | Delete
protected function get_disabled_attribute( $variable, $attr ) {
[1114] Fix | Delete
if ( $this->is_control_disabled( $variable ) || ( isset( $attr['disabled'] ) && $attr['disabled'] ) ) {
[1115] Fix | Delete
return ' disabled';
[1116] Fix | Delete
}
[1117] Fix | Delete
[1118] Fix | Delete
return '';
[1119] Fix | Delete
}
[1120] Fix | Delete
}
[1121] Fix | Delete
[1122] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function