Skip to content
Docs
Get RestroPress

Filter

rpress_admin_action_messages

Updated
On this page

Filters the confirmation messages shown as admin toasts for rpress-message results.

When an admin URL has an rpress-message query argument, its value is looked up in this list and shown as a toast if the user has the listed capability. Add entries for your own admin actions or change the wording of core ones. Each entry is a numeric array: capability, type (success, info or error) and plain text.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$messagesarrayMessage key => array( capability, type, text ).

Return value#

array. Messages in the same shape.

Example#

add_filter( 'rpress_admin_action_messages', 'my_action_messages', 10, 1 );
function my_action_messages( $messages ) {
	$messages['my_sync_done'] = array( 'manage_shop_settings', 'success', __( 'Menu synced.', 'my-plugin' ) );
	return $messages;
}

Source#

Applied in:

  • includes/features/admin-notices/messages.php (line 56), in rpress_admin_action_messages()

See also#

Was this page helpful?