Created
October 28, 2015 02:46
-
-
Save jameslaws/715c9260fadea5e1b311 to your computer and use it in GitHub Desktop.
Remove the Ninja Forms Add New Form button from wp_editor if non-admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function example_remove_add_new( $instance ) { | |
if ( ! current_user_can( 'manage_options' ) ) { | |
remove_filter( 'media_buttons_context', array( $instance->add_form_button, 'insert_form_tinymce_buttons' ) ); | |
} | |
} | |
add_action( 'nf_admin_init', 'example_remove_add_new' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment