What does this number indicate?

Community Forums Forums Design Tips and Tricks What does this number indicate?

This topic is: not resolved

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  nunotmp 10 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #62900

    thoughtwell
    Participant
    Post count: 12

    What does the number, “12″ indicate in the following snippet:
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );

    I see this throughout my PHP and the number changes. I try to see the connection/pattern as to why this is put in my code, but I fail to see it and I figured this is as good a place to ask as any.

    #62902

    nunotmp
    Participant
    Post count: 164

    Priority.

    This is useful with adding multiple functions to the same hook. Example:

    
    add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    add_action( 'genesis_entry_content', 'genesis_do_post_content' );
    add_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
    add_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );
    

    The lower then number the sooner the code will execute. If you wanted to add the post title just under the post image you can do something like

    
    add_action( 'genesis_entry_content', 'genesis_do_post_title', 9 );
    

    or above it with

    
    add_action( 'genesis_entry_content', 'genesis_do_post_title', 7 );
    

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.