From: Steve Sutton Date: Wed, 22 Apr 2015 18:56:50 +0000 (-0400) Subject: Add Form Submissions menu to wp admin X-Git-Tag: v1.4.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=7fae89726421172bf503f35e7383960d87f7a831;p=WP-Plugins%2FGaslightify.git Add Form Submissions menu to wp admin So editor role can have access to the Ninja Form submissions. --- diff --git a/Gaslightify.php b/Gaslightify.php index 0d0704d..89fd7b5 100755 --- a/Gaslightify.php +++ b/Gaslightify.php @@ -163,7 +163,17 @@ function glm_stats(){ } function Gaslightify_menu() { add_menu_page('Server Stats', 'Server Stats', 'edit_posts', 'glm_stats', 'glm_stats', 'dashicons-chart-area'); + add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback'); } add_action('admin_menu', 'Gaslightify_menu'); - +/* To give Editors access to the Submissions - Simply replace ‘edit_posts’ in the code snippet below with the capability +that you would like to attach the ability to view/edit submissions to.Please note that all three filters are needed to +provide proper submission viewing/editing on the backend! +*/ +function nf_subs_capabilities( $cap ) { + return 'edit_posts'; +} +add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' ); +add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' ); +//add_filter( 'ninja_forms_admin_menu_capabilities', 'nf_subs_capabilities' ); ?> diff --git a/css/Gaslightify.css b/css/Gaslightify.css index da03823..4ee80eb 100755 --- a/css/Gaslightify.css +++ b/css/Gaslightify.css @@ -27,6 +27,7 @@ select[name="seo_filter"], #metaslider_social, .ngg_admin_notice, #wpbody .updated, +#toplevel_page_ninja-forms, .cms_tpv_promo_above_wrapper { display: none !important; } @@ -37,4 +38,4 @@ select[name="seo_filter"], #wpadminbar #toplevel_page_metaslider .dashicons-before:before { content: "\f233" !important; -} \ No newline at end of file +} diff --git a/css/GaslightifyAdmin.css b/css/GaslightifyAdmin.css index c5605a4..acf53b1 100644 --- a/css/GaslightifyAdmin.css +++ b/css/GaslightifyAdmin.css @@ -11,4 +11,7 @@ and open the template in the editor. #wpadminbar #toplevel_page_metaslider .dashicons-before:before { content: "\f233" !important; -} \ No newline at end of file +} +#toplevel_page_edit-post_type-nf_sub { + display: none; +}