Skip to content

Instantly share code, notes, and snippets.

@klhall1987
Created February 23, 2016 15:35
Show Gist options
  • Save klhall1987/5c0450f6597c3b42aabf to your computer and use it in GitHub Desktop.
Save klhall1987/5c0450f6597c3b42aabf to your computer and use it in GitHub Desktop.
Removes add form meta boxes and tinyMCE buttons.
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/*
Plugin Name: Remove NF Meta Boxes
Description: Removes add form meta boxes and tinyMCE buttons.
Version: 1.0
Author: Kenny Hall
Author URI: http://kennyinthewild.com
*/
class Remove_NF_Meta_Boxes
{
public function __construct()
{
add_action('init', array( $this, 'custom_remove_meta_box' ) , 10);
if( ! isset( $_GET['form_id'] ) ){
add_action('media_buttons_context', array($this, 'remove_form_tinymce_button'), 9990);
}
}
public function custom_remove_meta_box()
{
remove_action('add_meta_boxes', 'ninja_forms_add_custom_box');
}
public function remove_form_tinymce_button()
{
remove_filter('media_buttons_context', array('NF_Admin_AddFormModel', 'insert_form_tinymce_buttons'), 9999);
}
}
return new Remove_NF_Meta_Boxes();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment