Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm having some trouble adding jquery-week-calendar to WordPress' admin interface using add_menu_page and other API methods. What I found out is that the default jquery-ui and other JavaScript references are interfering in the rendered calendar behavior.

How can I remove these extra scripts from the admin interface? load-scripts.php is called a couple of times, and I can't seem to deregister the scripts that the admin components like tinyMCE and others are calling.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

According to the load-scripts.php file, scripts that are not enqueued will not be loaded, so I don't need to worry about it when using hooks like admin_enqueue_scripts and the wp_deregister_script function.

foreach( $load as $handle ) {
    if ( !array_key_exists($handle, $wp_scripts->registered) )
        continue;

However, my problem with jQuery week calendar was with the wp-jquery-ui-dialog style. So, to solve this problem I just had to:

wp_deregister_style('wp-jquery-ui-dialog');
$scripts = array('jquery-ui-core', 'jquery-ui-widget',
    'jquery-ui-mouse', 'jquery-ui-resizable', 'jquery-ui-draggable',
    'jquery-ui-button', 'jquery-ui-position', 'jquery-ui-dialog');
foreach ($scripts as $s)
    wp_deregister_script($s);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.