Opened 9 years ago
Closed 9 years ago
#35233 closed defect (bug) (duplicate)
wp_insert_post with tax_input in cron / admin-ajax.php as guest
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
I have script to get auctions from other website and add in my WordPress. I use taxonomy for categories of auctions. I configured cron and test my script and I found problem - My script can't set taxonomies because user isn't logged in. My script:
<?php $postarr = array( 'post_title' => esc_html( $data['title'] ), 'post_type' => 'auctions', 'post_status' => 'publish', 'tax_input' => array( 'auctions-type' => array( 10 ), ) ); $auction_id = wp_insert_post( $postarr )
Why this don't work ? Because is if in wp-includes/post.php:3477:
<?php if ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) {
I think that this is bug
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Duplicate of #19373.