• One question, if this code to hide elements from the admin bar has priority 999:

    add_action( ‘admin_bar_menu’, ‘ocultar_boton_vista_previa’, 999 );
    function ocultar_boton_vista_previa( $wp_admin_bar ) {
    $wp_admin_bar->remove_node( ‘view-site’ );
    }

    So in the plugin priority should I change the default to 10? What if there are several priorities in the same code? What number should I put, the lowest, the highest or should I keep it at 10?

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    The snippet priority is separate from the hook priority, in your example.

    The snippet priority just determines the order the snippets are loaded – so if you had two hooks with the hook priority 999, then the snippet which is loaded first would call add_action first.

    Generally, you don’t need to worry about snippet priority unless you have one snippet which relies on another, or overrides the result of another.

Viewing 1 replies (of 1 total)
  • The topic ‘priority’ is closed to new replies.