From: Steve Sutton Date: Wed, 22 Mar 2017 22:00:01 +0000 (-0400) Subject: Update for api to setup admin links X-Git-Tag: v1.0.0^2~16 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=47591ea2426da238db5989ca418485b4b4f0461b;p=WP-Plugins%2Fglm-member-db-apis.git Update for api to setup admin links Setting up the admin urls for api --- diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 978f7dc..b628398 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -25,3 +25,46 @@ * * Also note that parameters will be in the context of the main admin controller constructor. */ + +// check the options for urls and setup admin urls for them in wordpress admin. +$starlineOptions = unserialize( get_option( GLM_MEMBERS_APIS_STARLINE_OPTION_NAME ) ); +if ( isset( $starlineOptions ) && $starlineOptions ) { + $starlineUrl = ( isset( $starlineOptions['ticketUrl'] ) ) ? $starlineOptions['ticketUrl'] : ''; + if ( $starlineUrl != '' ) { + add_action( 'admin_bar_menu', function( $wp_admin_bar ) use ( $starlineUrl ) { + $args = array( + 'id' => 'eventmanagement-starline', + 'title' => 'Starline Ticketing System', + 'href' => $starlineUrl . 'admin/', + 'meta' => array( + 'class' => 'eventmanagement', + 'title' => 'Ticketing System', + 'target' => '_blank' + ) + ); + $wp_admin_bar->add_node( $args ); + }, 999 ); + } +} + +$bibcoOptions = unserialize( get_option( GLM_MEMBERS_APIS_BIBCO_OPTION_NAME ) ); +if ( isset( $bibcoOptions ) && $bibcoOptions ) { + $calendarUrl = ( isset( $bibcoOptions['calendarUrl'] ) ) ? $bibcoOptions['calendarUrl'] : ''; + if ( $calendarUrl != '' ) { + add_action( 'admin_bar_menu', function( $wp_admin_bar ) use ( $calendarUrl ) { + if ( $calendarUrl != '' ) { + $args = array( + 'id' => 'eventmanagement-bibco', + 'title' => 'Bibco Calendar Schedule', + 'href' => $calendarUrl . 'admin/', + 'meta' => array( + 'class' => 'eventmanagement', + 'title' => 'Ticketing System', + 'target' => '_blank' + ) + ); + } + $wp_admin_bar->add_node( $args ); + }, 999 ); + } +}