Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Add priorities, and inline documentation for @hooked functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHerman committed Nov 18, 2016
1 parent 48ff6c5 commit 3b4dd86
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 6 deletions.
4 changes: 3 additions & 1 deletion content.php
Expand Up @@ -15,7 +15,7 @@
/**
* Fires inside the `article` element, before the content.
*
* @hooked primer_woo_shop_messages - 10
* @hooked primer_wc_shop_messages - 10
*
* @since 1.0.0
*/
Expand All @@ -34,6 +34,8 @@
/**
* Fires after templates/parts/loop/post template
*
* @hooked primer_add_post_meta - 10
*
* @since 1.0.0
*/
do_action( 'primer_after_post_title_template' );
Expand Down
4 changes: 4 additions & 0 deletions footer.php
Expand Up @@ -30,6 +30,8 @@
/**
* Fires inside the `<footer>` element.
*
* @hooked primer_add_footer_widgets - 10
*
* @since 1.0.0
*/
do_action( 'primer_footer' );
Expand All @@ -43,6 +45,8 @@
/**
* Fires after the `<footer>` element.
*
* @hooked primer_add_site_info - 10
*
* @since 1.0.0
*/
do_action( 'primer_after_footer' );
Expand Down
7 changes: 7 additions & 0 deletions header.php
Expand Up @@ -58,6 +58,9 @@
/**
* Fires inside the `<header>` element.
*
* @hooked primer_add_site_title - 5
* @hooked primer_add_hero - 7
*
* @since 1.0.0
*/
do_action( 'primer_header' );
Expand All @@ -80,6 +83,10 @@
/**
* Fires after the `<header>` element.
*
* @hooked primer_add_page_title - 10
* @hooked primer_add_primary_navigation - 11
* @hooked primer_add_primary_navigation - 12
*
* @since 1.0.0
*/
do_action( 'primer_after_header' );
Expand Down
8 changes: 4 additions & 4 deletions inc/hooks.php
Expand Up @@ -40,7 +40,7 @@ function primer_add_site_title() {
get_template_part( 'templates/parts/site-title' );

}
add_action( 'primer_header', 'primer_add_site_title' );
add_action( 'primer_header', 'primer_add_site_title', 5 );

/**
* Display hero element in the header.
Expand All @@ -57,7 +57,7 @@ function primer_add_hero() {
}

}
add_action( 'primer_header', 'primer_add_hero' );
add_action( 'primer_header', 'primer_add_hero', 7 );

/**
* Display content in the hero element.
Expand Down Expand Up @@ -131,7 +131,7 @@ function primer_add_primary_navigation() {
get_template_part( 'templates/parts/primary-navigation' );

}
add_action( 'primer_after_header', 'primer_add_primary_navigation' );
add_action( 'primer_after_header', 'primer_add_primary_navigation', 11 );

/**
* Display page titles after the header.
Expand All @@ -148,7 +148,7 @@ function primer_add_page_title() {
}

}
add_action( 'primer_after_header', 'primer_add_page_title' );
add_action( 'primer_after_header', 'primer_add_page_title', 12 );

/**
* Display post meta template.
Expand Down
2 changes: 2 additions & 0 deletions templates/parts/hero.php
Expand Up @@ -15,6 +15,8 @@
/**
* Fires inside the `.hero` element.
*
* @hooked primer_add_hero_content - 10
*
* @since 1.0.0
*/
do_action( 'primer_hero' );
Expand Down
2 changes: 1 addition & 1 deletion templates/parts/loop/page-content.php
Expand Up @@ -14,7 +14,7 @@
/**
* Fires inside the `.page-content` element, before the content.
*
* @hooked primer_woo_shop_messages - 10
* @hooked primer_wc_shop_messages - 10
*
* @since 1.0.0
*/
Expand Down
4 changes: 4 additions & 0 deletions templates/parts/primary-navigation.php
Expand Up @@ -13,6 +13,8 @@
/**
* Fires inside the `<div class="main-navigation-container">` element.
*
* @hooked primer_add_mobile_menu - 10
*
* @since 1.0.0
*/
do_action( 'primer_before_site_navigation' );
Expand All @@ -24,6 +26,8 @@
/**
* Fires inside the `<nav id="site-navigation" class="main-navigation">` element.
*
* @hooked primer_add_primary_menu - 10
*
* @since 1.0.0
*/
do_action( 'primer_site_navigation' );
Expand Down
4 changes: 4 additions & 0 deletions templates/parts/site-info.php
Expand Up @@ -17,6 +17,10 @@
/**
* Fires inside the `.site-info` element.
*
* @hooked primer_add_footer_navigation - 5
* @hooked primer_add_social_navigation - 7
* @hooked primer_add_credit - 10
*
* @since 1.0.0
*/
do_action( 'primer_site_info' );
Expand Down

0 comments on commit 3b4dd86

Please sign in to comment.