protected function prepare_args( array $args, array $required ) {

		// Check for required arguments.
		$required = \wp_parse_args( $required, [ 'tab_id' ] );

		foreach ( $required as $property ) {
			if ( ! isset( $args[ $property ] ) ) {
				throw new \InvalidArgumentException( "Missing argument '$property'." );
			}
		}

		// Add default arguments.
		$defaults = [
			'section'           => $args['tab_id'],
			'short'             => null,
			'label'             => null,
			'help_text'         => null,
			'inline_help'       => false,
			'attributes'        => [],
			'outer_attributes'  => [],
			'settings_args'     => [],
			'sanitize_callback' => null,
		];
		$args     = \wp_parse_args( $args, $defaults );

		return $args;
	}
protected function prepare_args( array $args, array $required ) {

		// Check for required arguments.
		$required = \wp_parse_args( $required, [ 'tab_id' ] );

		foreach ( $required as $property ) {
			if ( ! isset( $args[ $property ] ) ) {
				throw new \InvalidArgumentException( "Missing argument '$property'." );
			}
		}

		// Add default arguments.
		$defaults = [
			'section'           => $args['tab_id'],
			'short'             => null,
			'label'             => null,
			'help_text'         => null,
			'inline_help'       => false,
			'attributes'        => [],
			'outer_attributes'  => [],
			'settings_args'     => [],
			'sanitize_callback' => null,
		];
		$args     = \wp_parse_args( $args, $defaults );

		return $args;
	}
protected function prepare_args ( array $ args , array $ required ) { // Check for required arguments. $ required = \ wp_parse_args ( $ required , [ 'tab_id' ] ) ; foreach ( $ required as $ property ) { if ( ! isset ( $ args [ $ property ] ) ) { throw new \ InvalidArgumentException ( "Missing argument '$property'." ) ; } } // Add default arguments. $ defaults = [ 'section' => $ args [ 'tab_id' ] , 'short' => null , 'label' => null , 'help_text' => null , 'inline_help' => false , 'attributes' => [ ] , 'outer_attributes' => [ ] , 'settings_args' => [ ] , 'sanitize_callback' => null , ] ; $ args = \ wp_parse_args ( $ args , $ defaults ) ; return $ args ; }
Prepares keyowrd arguments passed via an array for usage.

@param array $args     Arguments.
@param array $required Required argument names. 'tab_id' is always required.

@return array

@throws \InvalidArgumentException Thrown when a required argument is missing.
Prepares keyowrd arguments passed via an array for usage .