ACF_Local_JSON::redirect_post_locationpublicACF 6.8.1

Appends a Local JSON save failure query arg to the post save redirect.

Method of the class: ACF_Local_JSON{}

No Hooks.

Returns

String.

Usage

$ACF_Local_JSON = new ACF_Local_JSON();
$ACF_Local_JSON->redirect_post_location( $location );
$location(string) (required)
The redirect location.

Changelog

Since 6.8.1 Introduced.

ACF_Local_JSON::redirect_post_location() code ACF 6.8.8

public function redirect_post_location( $location ) {
	if ( ! $this->has_save_file_failure() ) {
		return $location;
	}

	// Only users who can manage ACF should see ACF admin save state.
	if ( ! current_user_can( acf_get_setting( 'capability' ) ) ) {
		return $location;
	}

	return add_query_arg( 'acf_local_json_save_failed', 1, $location );
}