• Resolved Prajay

    (@prajay)


    Hello, everyone.

    i am working on one project where i am using post_title as my link for the particular post. like my slug for that post. it means it is my link for that post. but the problem is when i try to insert the record. everything is inserted perfectly expect post_title. that become null..

    here the code i am using? also i have tested that the $data array has all the value inside..

    function something()
    {

    $resume_args = array(
    ‘post_content’ => $data[‘resume_content’],
    ‘post_title’ => $data[‘title’],
    ‘post_name’ => sanitize_title($data[‘title’]),
    ‘post_status’ => ‘pending’,
    ‘post_type’ => ‘resume’,
    ‘post_author’ => $data[‘user_id’],
    );

    $resume_id = wp_insert_post( $resume_args );
    //print_r($resume_id);die;
    update_post_meta( $resume_id, ‘post_name’, sanitize_title($resume_args[‘post_name’]) );
    }

    can anyone help me what is the problem. right now i am working on it but i can not find any solution… please help me…

    many thanks in advance….

Viewing 1 replies (of 1 total)
  • Thread Starter Prajay

    (@prajay)

    well finally found the solution..

    it is nothing you just have to change the post_status to pending. than it will work..

    i do not know why it is like that but it is working that way..

    if any one else find any other solution please email me on [email protected]

Viewing 1 replies (of 1 total)
  • The topic ‘post_title is not inserted in the database.’ is closed to new replies.