From: Steve Sutton Date: Fri, 18 Nov 2016 15:00:21 +0000 (-0500) Subject: Put the add action in correct place for Event Reg X-Git-Tag: v1.0.0^2~9 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=3f67f09aaccab331c809840e628effa782d7b765;p=WP-Themes%2Fharborcountry.git Put the add action in correct place for Event Reg Putting the menu add action part into the Event Registration page from lib directory. --- diff --git a/functions.php b/functions.php index 600b687..ca98cbb 100644 --- a/functions.php +++ b/functions.php @@ -12,16 +12,3 @@ include_once 'lib/force-template-functions.php'; include_once 'lib/EventRegistration.php'; - add_action( 'admin_bar_menu', function( $wp_admin_bar ){ - $args = array( - 'id' => 'eventregistrations', - 'title' => 'Event Registrations', - 'href' => 'http://dev53.gaslightmedia.com/www.harborcountry.org/admin/', - 'meta' => array( - 'class' => 'eventregistrations', - 'title' => 'Event Registrations', - 'target' => '_blank' - ) - ); - $wp_admin_bar->add_node( $args ); - }, 999 ); diff --git a/lib/EventRegistration.php b/lib/EventRegistration.php index e2e68d5..b1c97ab 100644 --- a/lib/EventRegistration.php +++ b/lib/EventRegistration.php @@ -17,3 +17,16 @@ add_action( 'init', function(){ session_start(); } }); +add_action( 'admin_bar_menu', function( $wp_admin_bar ){ + $args = array( + 'id' => 'eventregistrations', + 'title' => 'Event Registrations', + 'href' => 'http://dev53.gaslightmedia.com/www.harborcountry.org/admin/', + 'meta' => array( + 'class' => 'eventregistrations', + 'title' => 'Event Registrations', + 'target' => '_blank' + ) + ); + $wp_admin_bar->add_node( $args ); +}, 999 );