WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
category is not being attached with the post with author type user (1 post)

  1. Aftab H.
    Member
    Posted 1 year ago #

    Hi.
    When I am adding a post from front end with category is not attached with the created post with 'author' type user.
    I think this is the role capability issue.

    I am using the script to add the post-

    $post = array(
    'post_author' => $user_ID,
    'post_name' => $inventory_area.$inventory_location,
    'post_status' => 'publish',
    'post_title' => $inventory_area.$inventory_location,
    'post_type' => 'product',
    /*'post_parent' => 0,
    'menu_order' => 0,*/
    'tax_input'=> array( 'product_cat' => $inventoy_category )

    );

    $postid=wp_insert_post($post);

    Plz help.
    Why category is not adding.?
    It is added with 'administrator' type and 'shop manager type'.

    Thanks
    Aftab

    http://wordpress.org/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.