How to enqueue javascript for WP Customize options sidebar?

Use the action customize_controls_enqueue_scripts: add_action( ‘customize_controls_enqueue_scripts’, ‘enqueue_customizer_scripts’ ); function enqueue_customizer_scripts() { wp_enqueue_script(); // fill in the details here } To add inline scripts in the header, use the action customize_controls_print_scripts. See wp-admin/customize.php for details.

How to disable wordpress from overload my stylesheet styles with customizer styles

I’m not familiar with the customizer specifically, but if it does it’s style inclusion properly (via wp_enqueue_style), then you can do something like the following in a plugin: function remove_or_reorganize_styles() { if ( wp_style_is(‘target-style-handle’, ‘enqueued’ ) ) { wp_dequeue_style( ‘target-style-handle’ ); } } add_action(‘wp_enqueue_scripts’, ‘remove_or_reorganize_styles’, 99); This assumes that target-style-handle is the handle used to … Read more

Redux callback action

This is an old question but if you are still looking, what you want is the dependency option. You can use it like this : Redux::setSection( $opt_name, array( ‘title’ => __( ‘Test’, ‘redux-test’ ), ‘id’ => ‘switch_buttonset’, ‘desc’ => __( ”, ‘redux-test’ ), ‘icon’ => ‘el el-cog’, ‘fields’ => array( array( ‘id’ => ‘switch-on’, ‘type’ … Read more

Update problem with update_option() in combination with register_setting()

Note what happens when you provide sanitize callback in register_setting(). It register a filter to sanitize your options add_filter( “sanitize_option_{$option_name}”, $sanitize_callback ); Now when you do update_option() then trigger your own function to prevent saving 😀 Because update_option() calls $value = sanitize_option( $option, $value ); Solution: Remove register_settings() callback before you call update_option(). function gtp_remove_installing_data() … Read more

How to: JQuery multiple wordpress media uploader buttons in the same options page?

What’s happening at the moment is that you’re assigning the selected media item to all three inputs in the following line: j(‘#preview-fav, #preview-grav, #preview-thumb’).val(attachment.url); In order to pass the value to only one of them, you need to change that line to respond to some kind of marker that’s been set in the buttons. In … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)