[wp-trac] [WordPress Trac] #33825: PHP warning on wp_insert_post, when tax_input variable is string
WordPress Trac
noreply at wordpress.org
Fri Sep 11 08:50:10 UTC 2015
#33825: PHP warning on wp_insert_post, when tax_input variable is string
-------------------------------+------------------------------
Reporter: ivan.jankovic | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 4.3
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------------+------------------------------
Comment (by swissspidy):
> Looks like tax_input argument expects an array, not string?
Yes, `tax_input` needs to be an array in the form of
{{{
array( 'my-taxonomy' => array( 'term-1', 'term-2' ) )
}}}
Otherwise the function doesn't know which taxonomy you mean. It has been
documented now:
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post-
functions.php#L2817
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33825#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list