Update for adding link to directory url
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 29 Jan 2019 21:36:27 +0000 (16:36 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 29 Jan 2019 21:36:27 +0000 (16:36 -0500)
For golf directory

setup/adminHooks.php

index b628398..52b4cb5 100644 (file)
@@ -59,7 +59,29 @@ if ( isset( $bibcoOptions ) && $bibcoOptions ) {
                     'href'  => $calendarUrl . 'admin/',
                     'meta'  => array(
                         'class'  => 'eventmanagement',
-                        'title'  => 'Ticketing System',
+                        'title'  => 'Schedule System',
+                        'target' => '_blank'
+                    )
+                );
+            }
+            $wp_admin_bar->add_node( $args );
+        }, 999 );
+    }
+}
+
+$golfClubOptions = unserialize( get_option( GLM_MEMBERS_APIS_GOLFCLUB_OPTION_NAME ) );
+if ( isset( $golfClubOptions ) && $golfClubOptions ) {
+    $golfUrl = ( isset( $golfClubOptions['directoryUrl'] ) ) ? $golfClubOptions['directoryUrl'] : '';
+    if ( $golfUrl != '' ) {
+        add_action( 'admin_bar_menu', function( $wp_admin_bar ) use ( $golfUrl ) {
+            if ( $golfUrl != '' ) {
+                $args = array(
+                    'id'    => 'eventmanagement-golf',
+                    'title' => 'Golf Directory',
+                    'href'  => $golfUrl . 'admin/',
+                    'meta'  => array(
+                        'class'  => 'eventmanagement',
+                        'title'  => 'Golf Directory',
                         'target' => '_blank'
                     )
                 );