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 find the 3.3 Tooltips annoying when I'm upgrading many live and dev sites. How do I disable them via functions.php? Unenqueue wp-includes/js/wp-pointer.js ?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

You could also remove the pointer script and style from their respective arrays just after they have been registered using this method.

// Remove javascript
add_action( 'wp_default_scripts' , 'remove_pointer_script' );
function remove_pointer_script( $wp_scripts ) {
    $wp_scripts->remove('wp-pointer');
}

// Remove stylesheet
add_action( 'wp_default_styles' , 'remove_pointer_style' );
function remove_pointer_style( $wp_styles ) {
    $wp_styles->remove('wp-pointer');
}

The remove method is part of the dependencies class which is extended by both the WP_Scripts and WP_Styles classes, it basically does the inverse of the add method, which is used inside core to register default scripts and styles. Mentioned incase you're curious where that method comes from and what it's for..

I suppose you could also encapsulate those actions in a current_user_can check also if you wanted to wipe them out for specific users, say admins.

if( current_user_can( 'manage_options' ) ) {
    add_action( 'wp_default_scripts' , 'remove_pointer_script' );
    add_action( 'wp_default_styles' , 'remove_pointer_style' );
}

Personally i quite like the new tooltips, and it's quite a shame there's not a simple API available for utilizing them in plugins yet, but i can see how it could be annoying when you're doing numerous installs or upgrades and just need to get things done.

share|improve this answer
    
Thanks, Mark. Interesting about the dependencies class; didn't know that. These things get more interesting the farther I get into them. I plan on leaving the tooltips in for beginning users, but I want to add the remove functions to several basic dev theme frameworks I use, at least for me, usually ID #1 user. –  songdogtech Dec 23 '11 at 16:46
    
Happy to help as always.. :) –  t31os Dec 23 '11 at 18:32
add comment

Yes, just dequeue the script (and the styles):

add_action('admin_enqueue_scripts', 'no_pointers');

function no_pointers(){
  wp_dequeue_script('wp-pointer');
  wp_dequeue_style('wp-pointer');
}

Or you can just disable them permanently for a specific user (only run once):

WP_Internal_Pointers::dismiss_pointers_for_new_users($user_id = 0);
share|improve this answer
    
Thanks! I had to give the answer to t31os for a more complete answer. But the php function to write to the database is helpful and I will look into that more. –  songdogtech Dec 23 '11 at 16:47
add comment

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.