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/content-.../inc/admin/inc
File: class-ps-dynamic-styles.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace passster;
[2] Fix | Delete
[3] Fix | Delete
class PS_Dynamic_Styles {
[4] Fix | Delete
/**
[5] Fix | Delete
* Contains instance or null
[6] Fix | Delete
*
[7] Fix | Delete
* @var object|null
[8] Fix | Delete
*/
[9] Fix | Delete
private static $instance = null;
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Returns instance of PS_Dynamic_Styles.
[13] Fix | Delete
*
[14] Fix | Delete
* @return object
[15] Fix | Delete
*/
[16] Fix | Delete
public static function get_instance() {
[17] Fix | Delete
if ( null === self::$instance ) {
[18] Fix | Delete
self::$instance = new self();
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
return self::$instance;
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Constructor.
[26] Fix | Delete
*
[27] Fix | Delete
* @return void
[28] Fix | Delete
*/
[29] Fix | Delete
public function __construct() {
[30] Fix | Delete
add_action( 'wp_head', array( $this, 'dynamic_styles' ) );
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* Add dynamic styles
[35] Fix | Delete
*
[36] Fix | Delete
* @return void
[37] Fix | Delete
*/
[38] Fix | Delete
public function dynamic_styles() {
[39] Fix | Delete
$options = get_option( 'passster' );
[40] Fix | Delete
[41] Fix | Delete
if ( isset( $options['button_font_size'] ) ) {
[42] Fix | Delete
$button_font_size = $options['button_font_size'];
[43] Fix | Delete
} else {
[44] Fix | Delete
$button_font_size = 12;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
if ( isset( $options['button_font_weight'] ) ) {
[48] Fix | Delete
$button_font_weight = $options['button_font_weight'];
[49] Fix | Delete
} else {
[50] Fix | Delete
$button_font_weight = 400;
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
// Set default padding/margin if missing.
[54] Fix | Delete
$form_spacing = [
[55] Fix | Delete
'margin' => [
[56] Fix | Delete
'top' => $options['form_margin']['top'] ?? 0,
[57] Fix | Delete
'right' => $options['form_margin']['right'] ?? 0,
[58] Fix | Delete
'bottom' => $options['form_margin']['bottom'] ?? 0,
[59] Fix | Delete
'left' => $options['form_margin']['left'] ?? 0,
[60] Fix | Delete
],
[61] Fix | Delete
'padding' => [
[62] Fix | Delete
'top' => $options['form_padding']['top'] ?? '10px',
[63] Fix | Delete
'right' => $options['form_padding']['right'] ?? '30px',
[64] Fix | Delete
'bottom' => $options['form_padding']['bottom'] ?? '30px',
[65] Fix | Delete
'left' => $options['form_padding']['left'] ?? '30px',
[66] Fix | Delete
],
[67] Fix | Delete
];
[68] Fix | Delete
[69] Fix | Delete
$button_spacing = [
[70] Fix | Delete
'margin' => [
[71] Fix | Delete
'top' => $options['button_margin']['top'] ?? 0,
[72] Fix | Delete
'right' => $options['button_margin']['right'] ?? 0,
[73] Fix | Delete
'bottom' => $options['button_margin']['bottom'] ?? 0,
[74] Fix | Delete
'left' => $options['button_margin']['left'] ?? 0,
[75] Fix | Delete
],
[76] Fix | Delete
'padding' => [
[77] Fix | Delete
'top' => $options['button_padding']['top'] ?? '10px',
[78] Fix | Delete
'right' => $options['button_padding']['right'] ?? '10px',
[79] Fix | Delete
'bottom' => $options['button_padding']['bottom'] ?? '10px',
[80] Fix | Delete
'left' => $options['button_padding']['left'] ?? '10px',
[81] Fix | Delete
],
[82] Fix | Delete
];
[83] Fix | Delete
[84] Fix | Delete
?>
[85] Fix | Delete
<style>
[86] Fix | Delete
.passster-form {
[87] Fix | Delete
max-width: <?php echo esc_html($options['form_max_width']); ?> !important;
[88] Fix | Delete
<?php if( isset($options['center_form']) && $options['center_form']) : ?> margin: 0 auto !important;
[89] Fix | Delete
<?php endif; ?>
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
.passster-form > form {
[93] Fix | Delete
background: <?php echo esc_html($options['form_background_color']); ?>;
[94] Fix | Delete
padding: <?php echo esc_html($form_spacing['padding']['top']); ?> <?php echo esc_html($form_spacing['padding']['right']); ?> <?php echo esc_html($form_spacing['padding']['bottom']); ?> <?php echo esc_html($form_spacing['padding']['left']); ?>;
[95] Fix | Delete
margin: <?php echo esc_html($form_spacing['margin']['top']); ?> <?php echo esc_html($form_spacing['margin']['right']); ?> <?php echo esc_html($form_spacing['margin']['bottom']); ?> <?php echo esc_html($form_spacing['margin']['left']); ?>;
[96] Fix | Delete
border-radius: <?php echo esc_html($options['form_border_radius']); ?>px;
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
.passster-form h4 {
[100] Fix | Delete
font-size: <?php echo esc_html($options['headline_font_size']); ?>px;
[101] Fix | Delete
font-weight: <?php echo esc_html($options['headline_font_weight']); ?>;
[102] Fix | Delete
color: <?php echo esc_html($options['headline_font_color']); ?>;
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
.passster-form p {
[106] Fix | Delete
font-size: <?php echo esc_html($options['instruction_font_size']); ?>px;
[107] Fix | Delete
font-weight: <?php echo esc_html($options['instruction_font_weight']); ?>;
[108] Fix | Delete
color: <?php echo esc_html($options['instruction_font_color']); ?>;
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
.passster-submit, .passster-submit-recaptcha {
[112] Fix | Delete
background: <?php echo esc_html($options['button_background_color']); ?>;
[113] Fix | Delete
padding: <?php echo esc_html($button_spacing['padding']['top']); ?> <?php echo esc_html($button_spacing['padding']['right']); ?> <?php echo esc_html($button_spacing['padding']['bottom']); ?> <?php echo esc_html($button_spacing['padding']['left']); ?>;
[114] Fix | Delete
margin: <?php echo esc_html($button_spacing['margin']['top']); ?> <?php echo esc_html($button_spacing['margin']['right']); ?> <?php echo esc_html($button_spacing['margin']['bottom']); ?> <?php echo esc_html($button_spacing['margin']['left']); ?>;
[115] Fix | Delete
border-radius: <?php echo esc_html($options['button_border_radius']); ?>px;
[116] Fix | Delete
font-size: <?php echo esc_html($button_font_size); ?>px;
[117] Fix | Delete
font-weight: <?php echo esc_html($button_font_weight); ?>;
[118] Fix | Delete
color: <?php echo esc_html($options['button_font_color']); ?>;
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
.passster-submit:hover, .passster-submit-recaptcha:hover {
[122] Fix | Delete
background: <?php echo esc_html($options['button_background_color_hover']); ?>;
[123] Fix | Delete
color: <?php echo esc_html($options['button_font_color_hover']); ?>;
[124] Fix | Delete
}
[125] Fix | Delete
</style>
[126] Fix | Delete
<?php
[127] Fix | Delete
}
[128] Fix | Delete
}
[129] Fix | Delete
[130] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function