/home/desid573/public_html/magicride.ng/wp-content/themes/euphony/inc/customizer
Edit: /home/desid573/public_html/magicride.ng/wp-content/themes/euphony/inc/customizer/reset.php (2586B)
esc_html__( 'Reset', 'euphony' ),
'confirm' => esc_html__( "Caution: Reset all settings to default. Process is irreversible.", 'euphony' ),
'nonce' => array(
'reset' => wp_create_nonce( 'euphony-customizer-reset' ),
),
'resetSection' => esc_html__( 'Reset section', 'euphony' ),
'confirmSection' => esc_html__( "Caution: Reset section settings to default. Process is irreversible.", 'euphony' ),
) );
}
/**
* Store a reference to `WP_Customize_Manager` instance
*
* @param $wp_customize
*/
public function customize_register( $wp_customize ) {
$this->wp_customize = $wp_customize;
}
public function ajax_customizer_reset() {
if ( ! $this->wp_customize->is_preview() ) {
wp_send_json_error( 'not_preview' );
}
if ( ! check_ajax_referer( 'euphony-customizer-reset', 'nonce', false ) ) {
wp_send_json_error( 'invalid_nonce' );
}
if ( 'all' === $_POST['section'] ) {
$this->reset_customizer();
}
wp_send_json_success();
}
public function reset_customizer() {
$settings = $this->wp_customize->settings();
// remove theme_mod settings registered in customizer
foreach ( $settings as $setting ) {
if ( 'theme_mod' == $setting->type ) {
remove_theme_mod( $setting->id );
}
}
}
}
}
Euphony_Customizer_Reset::get_instance();