llms_rest_not_found_error( string $message = '' )

Return a WP_Error with proper code, message and status for not found resources.


Parameters Parameters

$message

(string) (Optional) The custom error message. When no custom message is provided a predefined message will be used.

Default value: ''


Top ↑

Return Return

(WP_Error)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/llms-rest-server-functions.php

function llms_rest_not_found_error( $message = '' ) {
	$message = ! $message ? __( 'The requested resource could not be found.', 'lifterlms' ) : $message;
	return new WP_Error( 'llms_rest_not_found', $message, array( 'status' => WP_Http::NOT_FOUND ) ); // 404.
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.18 Use WP_Http constant for the error status.
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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