[wp-trac] [WordPress Trac] #31280: Remove need for numeric keys for admin post screen messages
WordPress Trac
noreply at wordpress.org
Tue Feb 10 10:38:16 UTC 2015
#31280: Remove need for numeric keys for admin post screen messages
-------------------------+------------------------------
Reporter: F J Kaiser | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 4.1
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------------------
Comment (by F J Kaiser):
In case someone stumbles upon this ticket while searching for a solution
of the problem, here's the temporary work around until this patch is
applied to a stable core release:
{{{
add_filter( 'post_updated_messages', function( $messages )
{
$index = 5;
$post_type = 'post';
while ( isset( $messages['post'][ $index ] ) )
{
$index++;
}
$messages[ $post_type ][ $index ] = __( 'Your custom message',
'your_textdomain' );
return $messages;
} );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31280#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list