post_updated_messages event stop working version 5.2.3
-
I really think that there is some problem with post_updated_messages event in 5.2.3 version. Thried the same code in vanila vrsion 4.9.11 and vanila 5.2.3. In 4.9.11 messages are overwritten and they are working good in 5.2.3 nothing’s happend.
Try to add next code in wp-content/plugins/hello.php and activate Hello Dolly plugin:function frl_change_post_updated_labels($messages){ /* change updated post labels */ global $post; $permalink = get_permalink($post->ID); $messages['post'] = array( 0 => '', 1 => sprintf( __('Article updated. <a href="%s">View post</a>', 'frl'), esc_url($permalink)), 2 => __('Custom field updated.', 'frl'), 3 => __('Custom field deleted.', 'frl'), 4 => __('Article updated.', 'frl'), 5 => isset($_GET['revision']) ? sprintf(__('Article restored to revision from %s', 'frl'), wp_post_revision_title((int)$_GET['revision'], false)) : false, 6 => sprintf( __('Article published. <a href="%s">View post</a>'), esc_url($permalink)), 7 => __('Article saved.', 'frl'), 8 => sprintf( __('Article submitted. <a target="_blank" href="%s" rel="noopener noreferrer">Preview</a>', 'frl'), esc_url(add_query_arg('preview','true', $permalink))), 9 => __('Article scheduled. <a target="_blank" href="%2$s" rel="noopener noreferrer">Preview</a>', 'frl'), 10 => sprintf( __('Article draft updated. <a target="_blank" href="%s" rel="noopener noreferrer">Preview</a>', 'frl'), esc_url(add_query_arg('preview', 'true', $permalink))) ); return $messages; } add_filter('post_updated_messages', 'frl_change_post_updated_labels');
Also tried adding new category ‘article’ instead of ‘post’ and create new array $messages[‘article’] and assinged post to article category but it is working the same.
So problem exists in both cases:
– when we want to overwrite existing messages (post, page, attachment)
– when we want to add new message typeI would be very thankfull if someone helps me with solving this.
Tnx.
- The topic ‘post_updated_messages event stop working version 5.2.3’ is closed to new replies.