: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php if ( ! defined( 'ABSPATH' ) ) exit;
* WordPress Menu Page Base Class
abstract class NF_Abstracts_Menu
* (required) The text to be displayed in the title tags of the page when the menu is selected
* (required) The on-screen name text for the menu
* (required) The capability required for this menu to be displayed to the user.
public $capability = 'manage_options';
* (required) The slug name to refer to this menu by (should be unique for this menu).
* (optional) The function that displays the page content for the menu page.
public $function = 'display';
* (optional) The icon for this menu.
* (optional) The position in the menu order this menu should appear.
* Translate text and add the 'admin_menu' action.
public function __construct()
add_action( 'admin_menu', array( $this, 'register' ) );
* Register the menu page.
public function register()
apply_filters( 'ninja_forms_menu_' . $this->get_menu_slug() . '_capability', $this->get_capability() ),
array( $this, $this->function ),
public function get_page_title()
return $this->page_title;
public function get_menu_title()
return ( $this->menu_title ) ? $this->menu_title : $this->get_page_title();
public function get_menu_slug()
return ( $this->menu_slug ) ? $this->menu_slug : 'nf-' . strtolower( preg_replace( '/[^A-Za-z0-9-]+/', '-', $this->get_menu_title() ) );
public function get_capability()
return $this->capability;
public abstract function display();