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/clone/wp-conte.../plugins/password.../includes/services
File: class-ppw-customizer-sitewide.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if ( ! class_exists( 'PPW_Customizer_Sitewide' ) ) {
[2] Fix | Delete
// TODO: need to force PPW_Pro_Customizer_Service extend this class to remove the code duplication.
[3] Fix | Delete
class PPW_Customizer_Sitewide {
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Instance of PPW_Pro_Shortcode class.
[7] Fix | Delete
*
[8] Fix | Delete
* @var PPW_Customizer_Sitewide
[9] Fix | Delete
*/
[10] Fix | Delete
protected static $instance = null;
[11] Fix | Delete
[12] Fix | Delete
public function register_sitewide_form() {
[13] Fix | Delete
add_action( 'customize_register', array( $this, 'customize_register' ), 15 );
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
public static function register_themes() {
[17] Fix | Delete
$self = new self();
[18] Fix | Delete
add_action( 'customize_register', array( $self, 'customize_register_themes' ), 25 );
[19] Fix | Delete
add_action( 'ppw_custom_style_form_entire_site', array( $self, 'load_css_to_pro' ), 15 );
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
public function register_sitewide_style() {
[23] Fix | Delete
add_action( PPW_Constants::HOOK_CUSTOM_STYLE_FORM_ENTIRE_SITE, array( $this, 'dynamic_styles' ) );
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* @param $wp_customize
[28] Fix | Delete
*/
[29] Fix | Delete
public function customize_register_themes( $wp_customize ) {
[30] Fix | Delete
if ( ! class_exists( 'PPW_Presets_Control' ) ) {
[31] Fix | Delete
include PPW_DIR_PATH . 'includes/customizers/class-ppw-presets.php';
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
$wp_customize->add_section( 'ppw_customize_presets', array(
[35] Fix | Delete
'title' => __( 'Themes', PPW_Constants::DOMAIN ),
[36] Fix | Delete
'panel' => 'ppwp_sitewide',
[37] Fix | Delete
'priority' => 50,
[38] Fix | Delete
) );
[39] Fix | Delete
[40] Fix | Delete
$wp_customize->add_setting( 'ppw_customize_presets_settings', array(
[41] Fix | Delete
'default' => 'default0',
[42] Fix | Delete
'capability' => 'edit_theme_options',
[43] Fix | Delete
) );
[44] Fix | Delete
[45] Fix | Delete
$wp_customize->add_control(
[46] Fix | Delete
new PPW_Presets_Control( $wp_customize, 'ppw_customize_presets_settings',
[47] Fix | Delete
array(
[48] Fix | Delete
'section' => 'ppw_customize_presets',
[49] Fix | Delete
// 'label' => __( 'Themes', 'loginpress' ),
[50] Fix | Delete
'choices' => $this->get_templates(),
[51] Fix | Delete
)
[52] Fix | Delete
)
[53] Fix | Delete
);
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Get instance of PPW_Customizer
[58] Fix | Delete
*
[59] Fix | Delete
* @return PPW_Customizer_Sitewide
[60] Fix | Delete
*/
[61] Fix | Delete
public static function get_instance() {
[62] Fix | Delete
if ( is_null( self::$instance ) ) {
[63] Fix | Delete
// Use static instead of self due to the inheritance later.
[64] Fix | Delete
// For example: ChildSC extends this class, when we call get_instance
[65] Fix | Delete
// it will return the object of child class. On the other hand, self function
[66] Fix | Delete
// will return the object of base class.
[67] Fix | Delete
self::$instance = new static();
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
return self::$instance;
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* Register customizer fields
[75] Fix | Delete
*
[76] Fix | Delete
* @param object $wp_customize customizer object.
[77] Fix | Delete
*
[78] Fix | Delete
* @return void
[79] Fix | Delete
*/
[80] Fix | Delete
public function customize_register( $wp_customize ) {
[81] Fix | Delete
if ( ! class_exists( 'PPW_Toggle_Control' ) ) {
[82] Fix | Delete
include PPW_DIR_PATH . 'includes/customizers/class-ppw-title-group-control.php';
[83] Fix | Delete
}
[84] Fix | Delete
if ( ! class_exists( 'PPW_Title_Group_Control' ) ) {
[85] Fix | Delete
include PPW_DIR_PATH . 'includes/customizers/class-ppw-toggle-control.php';
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
/* register toggle control */
[89] Fix | Delete
$wp_customize->register_control_type( 'PPW_Toggle_Control' );
[90] Fix | Delete
$wp_customize->register_control_type( 'PPW_Title_Group_Control' );
[91] Fix | Delete
[92] Fix | Delete
$wp_customize->add_panel( 'ppwp_sitewide',
[93] Fix | Delete
array(
[94] Fix | Delete
'priority' => 9980,
[95] Fix | Delete
'capability' => 'edit_theme_options',
[96] Fix | Delete
'theme_supports' => '',
[97] Fix | Delete
'title' => __( 'PPWP Sitewide Login Form', PPW_Constants::DOMAIN ),
[98] Fix | Delete
)
[99] Fix | Delete
);
[100] Fix | Delete
[101] Fix | Delete
/* form logo section */
[102] Fix | Delete
$wp_customize->add_section( 'ppwp_pro_form_logo', array(
[103] Fix | Delete
'title' => __( 'Logo', PPW_Constants::DOMAIN ),
[104] Fix | Delete
'panel' => 'ppwp_sitewide',
[105] Fix | Delete
'priority' => 100,
[106] Fix | Delete
) );
[107] Fix | Delete
[108] Fix | Delete
// Add an option to disable the logo.
[109] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_logo_disable' );
[110] Fix | Delete
$wp_customize->add_control(
[111] Fix | Delete
new PPW_Toggle_Control(
[112] Fix | Delete
$wp_customize,
[113] Fix | Delete
'ppwp_pro_logo_disable_control', array(
[114] Fix | Delete
'label' => __( 'Disable Logo', PPW_Constants::DOMAIN ),
[115] Fix | Delete
'section' => 'ppwp_pro_form_logo',
[116] Fix | Delete
'type' => 'toggle',
[117] Fix | Delete
'settings' => 'ppwp_pro_logo_disable',
[118] Fix | Delete
) )
[119] Fix | Delete
);
[120] Fix | Delete
[121] Fix | Delete
/* logo customize */
[122] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_logo_customize', array(
[123] Fix | Delete
'default' => __( PPW_DIR_URL . 'includes/views/entire-site/assets/ppwp-logo.png', PPW_Constants::DOMAIN ),
[124] Fix | Delete
) );
[125] Fix | Delete
[126] Fix | Delete
$wp_customize->add_control(
[127] Fix | Delete
new \WP_Customize_Image_Control(
[128] Fix | Delete
$wp_customize,
[129] Fix | Delete
'ppwp_pro_logo_customize_control', array(
[130] Fix | Delete
'label' => __( 'Logo Image', PPW_Constants::DOMAIN ),
[131] Fix | Delete
'section' => 'ppwp_pro_form_logo',
[132] Fix | Delete
'settings' => 'ppwp_pro_logo_customize',
[133] Fix | Delete
) )
[134] Fix | Delete
);
[135] Fix | Delete
[136] Fix | Delete
/* logo width */
[137] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_logo_customize_width' );
[138] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_logo_customize_width_control', array(
[139] Fix | Delete
'label' => __( 'Logo Width', PPW_Constants::DOMAIN ),
[140] Fix | Delete
'description' => __( 'Width in px', PPW_Constants::DOMAIN ),
[141] Fix | Delete
'section' => 'ppwp_pro_form_logo',
[142] Fix | Delete
'settings' => 'ppwp_pro_logo_customize_width',
[143] Fix | Delete
'type' => 'number',
[144] Fix | Delete
) );
[145] Fix | Delete
[146] Fix | Delete
/* logo height */
[147] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_logo_customize_height' );
[148] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_logo_customize_height_control', array(
[149] Fix | Delete
'label' => __( 'Logo Height', PPW_Constants::DOMAIN ),
[150] Fix | Delete
'description' => __( 'Height in px', PPW_Constants::DOMAIN ),
[151] Fix | Delete
'section' => 'ppwp_pro_form_logo',
[152] Fix | Delete
'settings' => 'ppwp_pro_logo_customize_height',
[153] Fix | Delete
'type' => 'number',
[154] Fix | Delete
) );
[155] Fix | Delete
[156] Fix | Delete
/* logo border-radius */
[157] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_logo_customize_border_radius' );
[158] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_logo_customize_border_radius_control', array(
[159] Fix | Delete
'label' => __( 'Logo Radius', PPW_Constants::DOMAIN ),
[160] Fix | Delete
'description' => __( 'Border Radius in %', PPW_Constants::DOMAIN ),
[161] Fix | Delete
'section' => 'ppwp_pro_form_logo',
[162] Fix | Delete
'settings' => 'ppwp_pro_logo_customize_border_radius',
[163] Fix | Delete
'type' => 'number',
[164] Fix | Delete
) );
[165] Fix | Delete
[166] Fix | Delete
/* password form section */
[167] Fix | Delete
$wp_customize->add_section( 'ppwp_pro_form_instructions', array(
[168] Fix | Delete
'title' => __( 'Password Form', PPW_Constants::DOMAIN ),
[169] Fix | Delete
'panel' => 'ppwp_sitewide',
[170] Fix | Delete
'priority' => 300,
[171] Fix | Delete
) );
[172] Fix | Delete
[173] Fix | Delete
/* form section group */
[174] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_section_group' );
[175] Fix | Delete
$wp_customize->add_control(
[176] Fix | Delete
new PPW_Title_Group_Control(
[177] Fix | Delete
$wp_customize,
[178] Fix | Delete
'ppwp_pro_form_section_group', array(
[179] Fix | Delete
'label' => __( 'Password Form', PPW_Constants::DOMAIN ),
[180] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[181] Fix | Delete
'settings' => 'ppwp_pro_form_section_group',
[182] Fix | Delete
'type' => 'control_title',
[183] Fix | Delete
) )
[184] Fix | Delete
);
[185] Fix | Delete
[186] Fix | Delete
/* form countdown section */
[187] Fix | Delete
[188] Fix | Delete
apply_filters('ppwp_customizer_custom_fields', $wp_customize, $wp_customize);
[189] Fix | Delete
[190] Fix | Delete
/* enable form transparency */
[191] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_enable_transparency' );
[192] Fix | Delete
$wp_customize->add_control(
[193] Fix | Delete
new PPW_Toggle_Control(
[194] Fix | Delete
$wp_customize,
[195] Fix | Delete
'ppwp_pro_form_enable_transparency_control', array(
[196] Fix | Delete
'label' => __( 'Enable Form Transparency', PPW_Constants::DOMAIN ),
[197] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[198] Fix | Delete
'type' => 'toggle',
[199] Fix | Delete
'settings' => 'ppwp_pro_form_enable_transparency',
[200] Fix | Delete
) )
[201] Fix | Delete
);
[202] Fix | Delete
[203] Fix | Delete
/* password form background color */
[204] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_instructions_background_color', array(
[205] Fix | Delete
'default' => '',
[206] Fix | Delete
) );
[207] Fix | Delete
[208] Fix | Delete
$wp_customize->add_control(
[209] Fix | Delete
new \WP_Customize_Color_Control(
[210] Fix | Delete
$wp_customize,
[211] Fix | Delete
'ppwp_pro_form_instructions_background_color_control', array(
[212] Fix | Delete
'label' => __( 'Form Background Color', PPW_Constants::DOMAIN ),
[213] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[214] Fix | Delete
'settings' => 'ppwp_pro_form_instructions_background_color',
[215] Fix | Delete
) )
[216] Fix | Delete
);
[217] Fix | Delete
[218] Fix | Delete
/* password form width */
[219] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_instructions_width' );
[220] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_form_instructions_width_control', array(
[221] Fix | Delete
'label' => __( 'Form Width', PPW_Constants::DOMAIN ),
[222] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[223] Fix | Delete
'settings' => 'ppwp_pro_form_instructions_width',
[224] Fix | Delete
'description' => 'Width in px',
[225] Fix | Delete
'type' => 'number',
[226] Fix | Delete
) );
[227] Fix | Delete
[228] Fix | Delete
/* password form border radius */
[229] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_instructions_border_radius' );
[230] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_form_instructions_border_radius_control', array(
[231] Fix | Delete
'label' => __( 'Form Border Radius', PPW_Constants::DOMAIN ),
[232] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[233] Fix | Delete
'settings' => 'ppwp_pro_form_instructions_border_radius',
[234] Fix | Delete
'description' => 'Border Radius in px',
[235] Fix | Delete
'type' => 'number',
[236] Fix | Delete
) );
[237] Fix | Delete
[238] Fix | Delete
/* password label group */
[239] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_password_label_group' );
[240] Fix | Delete
$wp_customize->add_control(
[241] Fix | Delete
new PPW_Title_Group_Control(
[242] Fix | Delete
$wp_customize,
[243] Fix | Delete
'ppwp_pro_password_label_group', array(
[244] Fix | Delete
'label' => __( 'Password Field', PPW_Constants::DOMAIN ),
[245] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[246] Fix | Delete
'settings' => 'ppwp_pro_password_label_group',
[247] Fix | Delete
'type' => 'control_title',
[248] Fix | Delete
) )
[249] Fix | Delete
);
[250] Fix | Delete
[251] Fix | Delete
/* password label font size */
[252] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_instructions_password_label_font_size' );
[253] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_form_instructions_password_label_font_size_control', array(
[254] Fix | Delete
'label' => __( 'Font Size', PPW_Constants::DOMAIN ),
[255] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[256] Fix | Delete
'settings' => 'ppwp_pro_form_instructions_password_label_font_size',
[257] Fix | Delete
'description' => __( 'Font size in px', PPW_Constants::DOMAIN ),
[258] Fix | Delete
'type' => 'number',
[259] Fix | Delete
) );
[260] Fix | Delete
[261] Fix | Delete
/* password label color */
[262] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_instructions_password_label_color' );
[263] Fix | Delete
$wp_customize->add_control(
[264] Fix | Delete
new \WP_Customize_Color_Control(
[265] Fix | Delete
$wp_customize,
[266] Fix | Delete
'ppwp_pro_form_instructions_password_label_color_control', array(
[267] Fix | Delete
'label' => __( 'Label Color', PPW_Constants::DOMAIN ),
[268] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[269] Fix | Delete
'settings' => 'ppwp_pro_form_instructions_password_label_color',
[270] Fix | Delete
) )
[271] Fix | Delete
);
[272] Fix | Delete
[273] Fix | Delete
/* placeholder text */
[274] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_instructions_placeholder' );
[275] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_form_instructions_placeholder_control', array(
[276] Fix | Delete
'label' => __( 'Placeholder', PPW_Constants::DOMAIN ),
[277] Fix | Delete
'section' => 'ppwp_pro_form_instructions',
[278] Fix | Delete
'settings' => 'ppwp_pro_form_instructions_placeholder',
[279] Fix | Delete
'type' => 'text',
[280] Fix | Delete
) );
[281] Fix | Delete
[282] Fix | Delete
/* form button section */
[283] Fix | Delete
$wp_customize->add_section( 'ppwp_pro_form_button', array(
[284] Fix | Delete
'title' => __( 'Button', PPW_Constants::DOMAIN ),
[285] Fix | Delete
'panel' => 'ppwp_sitewide',
[286] Fix | Delete
'priority' => 400,
[287] Fix | Delete
) );
[288] Fix | Delete
[289] Fix | Delete
/* button label */
[290] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_button_label', array(
[291] Fix | Delete
'default' => __( 'Enter', PPW_Constants::DOMAIN ),
[292] Fix | Delete
) );
[293] Fix | Delete
$wp_customize->add_control( 'ppwp_pro_form_button_label_control', array(
[294] Fix | Delete
'label' => __( 'Button Label', PPW_Constants::DOMAIN ),
[295] Fix | Delete
'section' => 'ppwp_pro_form_button',
[296] Fix | Delete
'settings' => 'ppwp_pro_form_button_label',
[297] Fix | Delete
'type' => 'text',
[298] Fix | Delete
) );
[299] Fix | Delete
[300] Fix | Delete
/* button text color */
[301] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_button_text_color' );
[302] Fix | Delete
$wp_customize->add_control(
[303] Fix | Delete
new \WP_Customize_Color_Control(
[304] Fix | Delete
$wp_customize,
[305] Fix | Delete
'ppwp_pro_form_button_text_color_control', array(
[306] Fix | Delete
'label' => __( 'Text Color', PPW_Constants::DOMAIN ),
[307] Fix | Delete
'section' => 'ppwp_pro_form_button',
[308] Fix | Delete
'settings' => 'ppwp_pro_form_button_text_color',
[309] Fix | Delete
) )
[310] Fix | Delete
);
[311] Fix | Delete
[312] Fix | Delete
/* button background color */
[313] Fix | Delete
$wp_customize->add_setting( 'ppwp_pro_form_button_background_color' );
[314] Fix | Delete
$wp_customize->add_control(
[315] Fix | Delete
new \WP_Customize_Color_Control(
[316] Fix | Delete
$wp_customize,
[317] Fix | Delete
'ppwp_pro_form_button_background_color_control', array(
[318] Fix | Delete
'label' => __( 'Background Color', PPW_Constants::DOMAIN ),
[319] Fix | Delete
'section' => 'ppwp_pro_form_button',
[320] Fix | Delete
'settings' => 'ppwp_pro_form_button_background_color',
[321] Fix | Delete
) )
[322] Fix | Delete
);
[323] Fix | Delete
}
[324] Fix | Delete
[325] Fix | Delete
/**
[326] Fix | Delete
* Add dynamic styles
[327] Fix | Delete
*
[328] Fix | Delete
* TODO: move this styles into css file.
[329] Fix | Delete
* @return void
[330] Fix | Delete
*/
[331] Fix | Delete
public function dynamic_styles() {
[332] Fix | Delete
$sw_custom_css = $this->get_preset_css();
[333] Fix | Delete
$sw_custom_css = $sw_custom_css . '
[334] Fix | Delete
.pda-form-login {
[335] Fix | Delete
width: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_instructions_width' ) ) . 'px!important;
[336] Fix | Delete
}
[337] Fix | Delete
[338] Fix | Delete
.pda-form-login label {
[339] Fix | Delete
font-size: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_instructions_password_label_font_size' ) ) . 'px!important;
[340] Fix | Delete
color: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_instructions_password_label_color' ) ) . '!important;
[341] Fix | Delete
}
[342] Fix | Delete
[343] Fix | Delete
.pda-form-login form {
[344] Fix | Delete
background-color: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_instructions_background_color' ) ) . '!important;
[345] Fix | Delete
border-radius: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_instructions_border_radius' ) ) . 'px!important;
[346] Fix | Delete
}
[347] Fix | Delete
[348] Fix | Delete
.pda-form-login a.ppw-swp-logo {
[349] Fix | Delete
background-image: none, url(' . esc_url( get_theme_mod( 'ppwp_pro_logo_customize', PPW_DIR_URL . 'includes/views/entire-site/assets/ppwp-logo.png' ) ) . ')!important;
[350] Fix | Delete
background-size: cover;
[351] Fix | Delete
width: ' . esc_attr( get_theme_mod( 'ppwp_pro_logo_customize_width', '' ) ) . 'px!important;
[352] Fix | Delete
height: ' . esc_attr( get_theme_mod( 'ppwp_pro_logo_customize_height', '' ) ) . 'px!important;
[353] Fix | Delete
border-radius: ' . esc_attr( get_theme_mod( 'ppwp_pro_logo_customize_border_radius', '' ) ) . '%!important;
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
.pda-form-login .button-login {
[357] Fix | Delete
color: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_button_text_color' ) ) . '!important;
[358] Fix | Delete
background-color: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_button_background_color' ) ) . '!important;
[359] Fix | Delete
border-color: ' . esc_attr( get_theme_mod( 'ppwp_pro_form_button_background_color' ) ) . '!important;
[360] Fix | Delete
}
[361] Fix | Delete
';
[362] Fix | Delete
[363] Fix | Delete
// remove space in $sw_custom_css.
[364] Fix | Delete
$sw_custom_css = $this->optimize_css( $sw_custom_css );
[365] Fix | Delete
echo $sw_custom_css; // phpcs:ignore -- we already escase inside the css
[366] Fix | Delete
}
[367] Fix | Delete
[368] Fix | Delete
/*
[369] Fix | Delete
* Optimize css.
[370] Fix | Delete
*/
[371] Fix | Delete
public function optimize_css( $sw_custom_css ) {
[372] Fix | Delete
return preg_replace( "/\s{2,}/", " ", str_replace( "\n", "", str_replace( ', ', ",", $sw_custom_css ) ) );
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
/**
[376] Fix | Delete
* Get templates.
[377] Fix | Delete
*
[378] Fix | Delete
* @return array
[379] Fix | Delete
*/
[380] Fix | Delete
public function get_templates() {
[381] Fix | Delete
$free_templates = array();
[382] Fix | Delete
$themes_name = array(
[383] Fix | Delete
__( 'Default', PPW_Constants::DOMAIN ),
[384] Fix | Delete
__( 'Event', PPW_Constants::DOMAIN ),
[385] Fix | Delete
__( 'Business', PPW_Constants::DOMAIN ),
[386] Fix | Delete
__( 'Wedding', PPW_Constants::DOMAIN ),
[387] Fix | Delete
);
[388] Fix | Delete
[389] Fix | Delete
foreach ( $themes_name as $index => $theme_name ) {
[390] Fix | Delete
$free_templates["default{$index}"] = array(
[391] Fix | Delete
'thumbnail' => PPW_DIR_URL . 'includes/customizers/assets/images/thumbnail/sw-default' . $index . '.png',
[392] Fix | Delete
'id' => "default{$index}",
[393] Fix | Delete
'name' => $theme_name,
[394] Fix | Delete
'css_file' => PPW_DIR_PATH . 'includes/customizers/assets/css/sw-default' . $index . '.php',
[395] Fix | Delete
);
[396] Fix | Delete
}
[397] Fix | Delete
[398] Fix | Delete
return apply_filters( 'ppw_customizer_sitewide_templates', $free_templates );
[399] Fix | Delete
}
[400] Fix | Delete
[401] Fix | Delete
/**
[402] Fix | Delete
* Get css of a theme.
[403] Fix | Delete
*
[404] Fix | Delete
* @return string
[405] Fix | Delete
*/
[406] Fix | Delete
public function get_preset_css() {
[407] Fix | Delete
$default_preset = 'default0';
[408] Fix | Delete
$preset = esc_attr( get_theme_mod( 'ppw_customize_presets_settings', $default_preset ) );
[409] Fix | Delete
$sw_custom_css = '';
[410] Fix | Delete
if ( $preset !== $default_preset ) {
[411] Fix | Delete
$templates = $this->get_templates();
[412] Fix | Delete
if ( isset( $templates[ $preset ], $templates[ $preset ]['css_file'] ) ) {
[413] Fix | Delete
ob_start();
[414] Fix | Delete
include_once( $templates[ $preset ]['css_file'] );
[415] Fix | Delete
?>
[416] Fix | Delete
@media screen and (max-width: 768px) {
[417] Fix | Delete
.pda-form-login {
[418] Fix | Delete
width: 100%;
[419] Fix | Delete
}
[420] Fix | Delete
.pda-form-login form {
[421] Fix | Delete
width: 90%;
[422] Fix | Delete
}
[423] Fix | Delete
}
[424] Fix | Delete
<?php
[425] Fix | Delete
$sw_custom_css = ob_get_clean();
[426] Fix | Delete
}
[427] Fix | Delete
}
[428] Fix | Delete
[429] Fix | Delete
return $sw_custom_css;
[430] Fix | Delete
}
[431] Fix | Delete
[432] Fix | Delete
public function load_css_to_pro() {
[433] Fix | Delete
echo $this->optimize_css( $this->get_preset_css() ); // phpcs:ignores -- we don't need to escape css, already escape $preset above
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
[437] Fix | Delete
}
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function