Update for api to setup admin links
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 22 Mar 2017 22:00:01 +0000 (18:00 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 22 Mar 2017 22:00:01 +0000 (18:00 -0400)
Setting up the admin urls for api

setup/adminHooks.php

index 978f7dc..b628398 100644 (file)
  *
  *  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 );
+    }
+}