• lock255

    (@lock255)


    Hello everyone,
    I have this code

    if(!$hasError)
                {
                    $post_information = array(
                        'post_title' => esc_attr(strip_tags($_POST['postTitle'])),
                        'post_content' => esc_attr(strip_tags($_POST['postContent'])),
                        'post_category'=>wp_get_post_categories( get_the_ID(), array('fields' => 'ids') ),
                        'post_type' => 'post',
                        'post_status' => 'pending',
                        'post_parent'=>get_the_ID(),
                    );

    I would like to ‘post_category a category with id 72, state that I am a beginner, I tried to put this figure in the parentheses of get_the_ID, changing forms etc .. but not working properly. I tried to guradare the wordpress documentation, but I could not figure out how to set my class properly.
    I would be grateful if someone would help me.
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help to set ID category wordpress’ is closed to new replies.