src/class-wp-menu.php
private static function required_params_exist( $type, $data ) {

		$required = [ 'name', 'slug' ];

		if ( 'submenu' === $type ) {
			array_push( $required, 'parent' );
		}

		foreach ( $required as $field ) {
			if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
				return false;
			}
		}

		return true;
	}
private static function required_params_exist( $type, $data ) {

		$required = [ 'name', 'slug' ];

		if ( 'submenu' === $type ) {
			array_push( $required, 'parent' );
		}

		foreach ( $required as $field ) {
			if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
				return false;
			}
		}

		return true;
	}
private static function required_params_exist ( $ type , $ data ) { $ required = [ 'name' , 'slug' ] ; if ( 'submenu' === $ type ) { array_push ( $ required , 'parent' ) ; } foreach ( $ required as $ field ) { if ( ! isset ( $ data [ $ field ] ) || empty ( $ data [ $ field ] ) ) { return false ; } } return true ; }
Validate if the required parameters exist.

@since 1.0.4

@param string $type → menu | submenu.
@param array  $data → settings.

@return boolean
Validate if the required parameters exist .