From: Steve Sutton Date: Thu, 28 Dec 2017 13:44:14 +0000 (-0500) Subject: Check if user can edit posts first. X-Git-Tag: v1.1.23^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b61e3a02555077ac2204c70af6185e32688fe74e;p=WP-Themes%2Fsaultstemarie.git Check if user can edit posts first. For showing ticketing system link in admin. --- diff --git a/lib/Ticketing.php b/lib/Ticketing.php index 34d6a95..fb4d2fc 100644 --- a/lib/Ticketing.php +++ b/lib/Ticketing.php @@ -1,14 +1,16 @@ 'eventmanagement', - 'title' => 'Ticketing System', - 'href' => 'https://tickets.saultstemarie.com/admin/', - 'meta' => array( - 'class' => 'eventmanagement', - 'title' => 'Ticketing System', - 'target' => '_blank' - ) - ); - $wp_admin_bar->add_node( $args ); + if ( current_user_can( 'edit_posts' ) ) { + $args = array( + 'id' => 'eventmanagement', + 'title' => 'Ticketing System', + 'href' => 'https://tickets.saultstemarie.com/admin/', + 'meta' => array( + 'class' => 'eventmanagement', + 'title' => 'Ticketing System', + 'target' => '_blank' + ) + ); + $wp_admin_bar->add_node( $args ); + } }, 999 );