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.../httpdocs/wp-conte.../plugins/wordpres.../includes/admin
File: class-wws-admin-metabox.php
<?php
[0] Fix | Delete
defined( 'ABSPATH' ) || exit;
[1] Fix | Delete
[2] Fix | Delete
class WWS_Admin_Metabox {
[3] Fix | Delete
[4] Fix | Delete
public function __construct() {
[5] Fix | Delete
add_action( 'add_meta_boxes', array( $this, 'add_custom_box' ) );
[6] Fix | Delete
add_action( 'save_post', array( $this, 'save_postdata' ) );
[7] Fix | Delete
}
[8] Fix | Delete
[9] Fix | Delete
public function add_custom_box() {
[10] Fix | Delete
add_meta_box(
[11] Fix | Delete
'wwsMetaboxDiv', // Unique ID
[12] Fix | Delete
esc_html__( 'WordPress WhatsApp Support', 'wc-wws' ), // Box title
[13] Fix | Delete
array( $this, 'custom_box_html' ), // Content callback, must be of type callable
[14] Fix | Delete
apply_filters( 'wws_post_metabox_screens', array( 'post', 'page', 'product' ) ), // Post type
[15] Fix | Delete
'side',
[16] Fix | Delete
'low'
[17] Fix | Delete
);
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
public function custom_box_html( $post ) {
[21] Fix | Delete
$support_contact_number = get_post_meta( $post->ID, '_wws_support_contact_number', true );
[22] Fix | Delete
$about_support_text = get_post_meta( $post->ID, '_wws_about_support_text', true );
[23] Fix | Delete
$trigger_button_text = get_post_meta( $post->ID, '_wws_trigger_button_text', true );
[24] Fix | Delete
$predefined_text = get_post_meta( $post->ID, '_wws_predefined_text', true );
[25] Fix | Delete
?>
[26] Fix | Delete
<?php do_action( 'wws_admin_post_metabox_notice' ); ?>
[27] Fix | Delete
<?php if ( $this->is_single_support() ) : ?>
[28] Fix | Delete
<div class="components-base-control">
[29] Fix | Delete
<div class="components-base-control__field">
[30] Fix | Delete
<label for="" class="components-base-control__label"><?php esc_html_e( 'Support Contact Number', 'wc-wws' ); ?></label>
[31] Fix | Delete
<input type="text" class="components-select-control__input" name="_wws_support_contact_number" value="<?php echo esc_attr( $support_contact_number ); ?>">
[32] Fix | Delete
</div>
[33] Fix | Delete
</div>
[34] Fix | Delete
<?php endif; ?>
[35] Fix | Delete
<div class="components-base-control">
[36] Fix | Delete
<div class="components-base-control__field">
[37] Fix | Delete
<label for="" class="components-base-control__label"><?php esc_html_e( 'About Support Text', 'wc-wws' ); ?></label>
[38] Fix | Delete
<textarea class="components-textarea-control__input" name="_wws_about_support_text" rows="5" style="width: 100%;"><?php echo esc_textarea( $about_support_text ); ?></textarea>
[39] Fix | Delete
</div>
[40] Fix | Delete
</div>
[41] Fix | Delete
<?php if ( $this->is_single_support() ) : ?>
[42] Fix | Delete
<div class="components-base-control">
[43] Fix | Delete
<div class="components-base-control__field">
[44] Fix | Delete
<label for="" class="components-base-control__label"><?php esc_html_e( 'Predefined Message', 'wc-wws' ); ?></label>
[45] Fix | Delete
<textarea class="components-textarea-control__input" name="_wws_predefined_text" rows="5" style="width: 100%;"><?php echo esc_textarea( $predefined_text ); ?></textarea>
[46] Fix | Delete
<p class="description"><?php echo wp_kses_post( sprintf( __( '%s to display current page title in chat.<br>%s to display current page URL in chat.<br>%s to break the line into a new line.', 'wc-wws' ), '<code>{title}</code>', '<code>{url}</code>', '<code>{br}</code>' ) ) ?></p>
[47] Fix | Delete
</div>
[48] Fix | Delete
</div>
[49] Fix | Delete
<?php endif; ?>
[50] Fix | Delete
<div class="components-base-control">
[51] Fix | Delete
<div class="components-base-control__field">
[52] Fix | Delete
<label for="" class="components-base-control__label"><?php esc_html_e( 'Trigger Button Text', 'wc-wws' ); ?></label>
[53] Fix | Delete
<input type="text" class="components-select-control__input" name="_wws_trigger_button_text" value="<?php echo esc_attr( $trigger_button_text ); ?>">
[54] Fix | Delete
</div>
[55] Fix | Delete
</div>
[56] Fix | Delete
<?php
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
public function save_postdata( $post_id ) {
[60] Fix | Delete
if ( array_key_exists( '_wws_support_contact_number', $_POST ) ) {
[61] Fix | Delete
update_post_meta(
[62] Fix | Delete
$post_id,
[63] Fix | Delete
'_wws_support_contact_number',
[64] Fix | Delete
sanitize_text_field( $_POST['_wws_support_contact_number'] )
[65] Fix | Delete
);
[66] Fix | Delete
}
[67] Fix | Delete
if ( array_key_exists( '_wws_about_support_text', $_POST ) ) {
[68] Fix | Delete
update_post_meta(
[69] Fix | Delete
$post_id,
[70] Fix | Delete
'_wws_about_support_text',
[71] Fix | Delete
sanitize_textarea_field( $_POST['_wws_about_support_text'] )
[72] Fix | Delete
);
[73] Fix | Delete
}
[74] Fix | Delete
if ( array_key_exists( '_wws_trigger_button_text', $_POST ) ) {
[75] Fix | Delete
update_post_meta(
[76] Fix | Delete
$post_id,
[77] Fix | Delete
'_wws_trigger_button_text',
[78] Fix | Delete
sanitize_textarea_field( $_POST['_wws_trigger_button_text'] )
[79] Fix | Delete
);
[80] Fix | Delete
}
[81] Fix | Delete
if ( array_key_exists( '_wws_predefined_text', $_POST ) ) {
[82] Fix | Delete
update_post_meta(
[83] Fix | Delete
$post_id,
[84] Fix | Delete
'_wws_predefined_text',
[85] Fix | Delete
sanitize_textarea_field( $_POST['_wws_predefined_text'] )
[86] Fix | Delete
);
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
private function is_single_support() {
[92] Fix | Delete
return in_array( get_option( 'wws_layout' ), array( '1', '2', '3', '4', '7' ) );
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
new WWS_Admin_Metabox;
[98] Fix | Delete
[99] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function