[wp-trac] [WordPress Trac] #48769: meta_input, tax_input, tags_input and post_category arguments are not available in functions or methods hooked to wp_insert_post
WordPress Trac
noreply at wordpress.org
Fri Nov 22 15:24:55 UTC 2019
#48769: meta_input, tax_input, tags_input and post_category arguments are not
available in functions or methods hooked to wp_insert_post
--------------------------+-----------------------------
Reporter: henry.wright | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Functions and methods hooked to `wp_insert_post` are currently passed
`$post_ID`, `$post` and `$update`. When a call to `wp_insert_post()` is
made we can pass an array argument. The array can have `meta_input`,
`tax_input`, `tags_input` and `post_category` elements.
Current call to `do_action()`:
{{{
do_action( 'wp_insert_post', $post_ID, $post, $update );
}}}
Proposal:
{{{
do_action( 'wp_insert_post', $post_ID, $post, $update, $postarr );
}}}
Thoughts:
`$postarr` could be either the raw array passed to `wp_insert_post()` or
the result of the raw array being merged with the set of defaults used.
There are more hooks in the `wp_insert_post()` function such as
`save_post`. These could be updated in the same way for consistency.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48769>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list