WordPress.org

Make WordPress Core

Opened 23 months ago

Last modified 6 months ago

#21641 new enhancement

Filter on pending/draft array in wp_insert_post()

Reported by: villagora Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Hi

In wp_insert_post() function, there is no possibility to add a status to the list of status for which postname can be set to empty (no filter). Thus, to have the 'pending' like behaviour for a custom status it seems you have to update the postname to and the gmt to 000-00 after the insert, as you have to hack the permalink construction too.

In the same way, it would be nice to add the $post parameter to the filter 'display_post_states' in the '_post_states($post)' function (wp-admin/includes/template.php), in order to add easily a post state according to a custom status of the post (seems better as retrieving the global $post of the admin loop).

Hope these are real issues. Sorry if not.

Regards

Change History (2)

comment:1 netweb7 months ago

Related: r24028

comment:2 nacin6 months ago

  • Component changed from General to Post Types
Note: See TracTickets for help on using tickets.