admin管理员组

文章数量:1122846

I am learning Plugin development. I am working on post_updated_messages filter.

How can I get an array key like popup in this array ?

I am learning Plugin development. I am working on post_updated_messages filter.

How can I get an array key like popup in this array ?

Share Improve this question asked Aug 2, 2024 at 16:39 FoysalFoysal 4451 gold badge5 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The function you attach as a filter needs to take in a variable as an argument and return that variable once it's done processing whatever it is you need it to do. For example:

function wpse426272_messages( $messages ) {

  $messages['game'] = array( 'Game updated', 'Game published', 'etc' );
      
  return $messages;
}

add_filter( 'post_updated_messages', 'wpse426272_messages' );

本文标签: plugin developmentpostupdatedmessages filter