Skip to content

Commit

Permalink
Add documentation, amend initial function hook, simplify nav menu reg…
Browse files Browse the repository at this point in the history
…istration
  • Loading branch information
GaryJones committed Nov 7, 2014
1 parent d306984 commit f69d788
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions genesis-header-nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@
$genesis_header_nav = new Genesis_Header_Nav;

add_action( 'plugins_loaded', 'genesis_header_nav_i18n' );

/**
* Load Genesis Header Nav plugin text domain.
*
* @since 2.0.0
*/
function genesis_header_nav_i18n() {
load_plugin_textdomain( 'genesis-header-nav', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}

add_action( 'init', 'genesis_header_nav_run' );

add_action( 'after_setup_theme', 'genesis_header_nav_run' );
/**
* Run Genesis Header Nav plugin.
*
* @since 2.0.0
*/
function genesis_header_nav_run() {
global $genesis_header_nav;
$genesis_header_nav->run();
Expand Down
4 changes: 2 additions & 2 deletions includes/class-genesis-header-nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Genesis_Header_Nav {
* @since 1.0.0
*/
public function run() {
add_action( 'init', array( $this, 'register_nav_menu' ), 15 );
add_action( 'init', array( $this, 'register_nav_menu' ) );
add_action( 'genesis_header', array( $this, 'show_menu' ), apply_filters( 'genesis_header_nav_priority', 12 ) );
add_filter( 'body_class', array( $this, 'body_classes' ), 15 );
}
Expand All @@ -37,7 +37,7 @@ public function run() {
* @since 1.0.0
*/
public function register_nav_menu() {
register_nav_menus( array( 'header' => __( 'Header', 'genesis-header-nav' ) ) );
register_nav_menu( 'header', __( 'Header', 'genesis-header-nav' ) );
}

/**
Expand Down

0 comments on commit f69d788

Please sign in to comment.