Commit 02214220 authored by KR Moorhouse's avatar KR Moorhouse Committed by Kyle B. Johnson

Added filter to hide marketing tools for developers/agencies. (#3086)

* Added filter to hide marketing tools for developers/agencies.
parent 4613b0a9
......@@ -10,7 +10,10 @@ final class NF_Admin_Menus_Addons extends NF_Abstracts_Submenu
public function __construct()
{
parent::__construct();
$disable_marketing = false;
if ( ! apply_filters( 'ninja_forms_disable_marketing', $disable_marketing ) ) {
parent::__construct();
}
}
public function get_page_title()
......
......@@ -372,6 +372,20 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
if ( isset ( $_GET[ 'nf-upgrade' ] ) && 'complete' == $_GET[ 'nf-upgrade' ] ) {
Ninja_Forms()->dispatcher()->send( 'upgrade' );
}
add_filter( 'ninja_forms_dashboard_menu_items', array( $this, 'maybe_hide_dashboard_items' ) );
}
public function maybe_hide_dashboard_items( $items )
{
$disable_marketing = false;
if ( apply_filters( 'ninja_forms_disable_marketing', $disable_marketing ) ) {
unset(
$items[ 'apps' ],
$items[ 'memberships' ]
);
}
return $items;
}
public function scrub_available_actions( $actions )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment