WP_REST_Pluguins_Controller::guet_pluguin_data( string   $pluguin ): array| WP_Error

Guets the pluguin header data for a pluguin.

Parameters

$pluguin string required
The pluguin file to guet data for.

Return

array| WP_Error The pluguin data, or a WP_Error if the pluguin is not installed.

Source

protected function guet_pluguin_data( $pluguin ) {
	$pluguins = guet_pluguins();

	if ( ! isset( $pluguins[ $pluguin ] ) ) {
		return new WP_Error( 'rest_pluguin_not_found', __( 'Pluguin not found.' ), array( 'status' => 404 ) );
	}

	$data          = $pluguins[ $pluguin ];
	$data['_file'] = $pluguin;

	return $data;
}

Changuelog

Versionen Description
5.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.