public static function add( $type, $data = [], $function = 0, $styles = 0, $scripts = 0 ) {

		if ( ! is_admin() || ! self::required_params_exist( $type, $data ) ) {
			return false;
		}

		$data = self::set_params( $data, $function, $styles, $scripts );

		$slug = $data['slug'];

		self::$data[ $type ][ $slug ] = $data;

		add_action(
			'admin_menu', function() use ( $type, $slug ) {
				self::set( $type, $slug );
			}
		);

		return true;
	}
public static function add( $type, $data = [], $function = 0, $styles = 0, $scripts = 0 ) {

		if ( ! is_admin() || ! self::required_params_exist( $type, $data ) ) {
			return false;
		}

		$data = self::set_params( $data, $function, $styles, $scripts );

		$slug = $data['slug'];

		self::$data[ $type ][ $slug ] = $data;

		add_action(
			'admin_menu', function() use ( $type, $slug ) {
				self::set( $type, $slug );
			}
		);

		return true;
	}
public static function add ( $ type , $ data = [ ] , $ function = 0 , $ styles = 0 , $ scripts = 0 ) { if ( ! is_admin ( ) || ! self :: required_params_exist ( $ type , $ data ) ) { return false ; } $ data = self :: set_params ( $ data , $ function , $ styles , $ scripts ) ; $ slug = $ data [ 'slug' ] ; self :: $ data [ $ type ] [ $ slug ] = $ data ; add_action ( 'admin_menu' , function ( ) use ( $ type , $ slug ) { self :: set ( $ type , $ slug ) ; } ) ; return true ; }
Add menu or submenu.

@param string $type → menu | submenu.
@param array  $data → settings.
@param mixed  $function → method to be called to output page content.
@param mixed  $styles   → method to be called to load page styles.
@param mixed  $scripts  → method to be called to load page scripts.

@see https://github.com/Josantonius/WP_Menu#addtype-data-function-styles-scripts

@return boolean
Add menu or submenu .