WordPress custom post_status after 6.6 version

Can you post your js or try this? import { addFilter } from ‘@wordpress/hooks’; addFilter( ‘editor.PostStatus.statuses’, ‘sq/add-custom-post-status’, // custom filter name (statuses) => { return [ …statuses, // save old statuses { // add new status slug: ‘prepare’, label: ‘Prepare’, labelShort: ‘Prepare’, public: false, }, ]; } );

How to keep prev/next nav on posts in same taxonomy

There’s a decent stack of functions here: next_post_link() get_next_post_link() get_adjacent_post_link() get_adjacent_post() Unfortunately, within this stack of functions, there aren’t any filters that are intended to change the $in_same_term parameter. Probably the best approach would be to create a child theme and override the single.php file within the child theme, and change the parameters of next_post_link() … Read more

How to restore post to pending status (no draft)

The official documentation for wp_untrash_post documents a filter for setting the status that it will use: https://developer.wordpress.org/reference/functions/wp_untrash_post/ This filter can be used to return pending instead as the status. If that’s not an option though, you could set the post status to pending after calling wp_untrash_post, it doesn’t have to happen in a single function … Read more

How to delete Full Size options from post Add Media?

function remove_extra_image_sizes() { foreach ( get_intermediate_image_sizes() as $size ) { if ( in_array( $size, array( ‘full’ ) ) ) { remove_image_size( $size ); } } } add_action(‘init’, ‘remove_extra_image_sizes’); Ref: remove_image_size() function I think this will help you.

Single post template not working in wordpress

When we’re editing a post, the post editor is used to define the post’s content (and associated meta data). Meanwhile, the Block Templates within the Site Editor as you have accessed via Appearance > Editor > Templates define how the site and content is laid out and rendered. Admittedly none of the terminology terribly intuitive, … Read more

Plugin or code to send out email to admin when a post is created

No need for plugin here are a few lines of code you can modify and paste in your themes functions.php file and you will get a new email whenever a post is published: add_action(‘publish_post’, ‘send_admin_email’); function send_admin_email($post_id){ $to = ‘[email protected]’; $subject=”mail subject here”; $message = “your message here ex: new post published at: “.get_permalink($post_id); wp_mail($to, … Read more