• Resolved herculesnetwork

    (@herculesnetwork)


    I have a file of autoimport.php

    
        $identif = (string)$numbz;
        $myembed = (string)$feed_item->embed;
        $feed_item->desc .= "{$identif}{$myembed}<br>{$feed_item->desc}";
    $post = array(
            'post_author'     => '1',
            'post_status'     => $_POST['status'],
            'post_type'       => $cpt,
            'post_title'      => (string)$feed_item->title,
            'post_content'    => (string)$feed_item->desc,
            );
        $post_id = wp_insert_post( $post );
        update_post_meta($post_id, 'sponsor',  (string)$_POST['thelink']);
        update_post_meta($post_id, 'contID',  (string)$feed_item->id);
    

    There are two variables that I add in post_content in the publish action, always right with manual posting, but when the plugin uses another file to do the import of the post, to trigger the post, this variable $myembed does not enter at all in post_content. Why does it happen? I make the change in the two files, all right in the manual post. Importmanual.php has a code almost the same as above, with difference that use post_args:

    
    $post_args = array(
              'post_author'     => '1',
              'post_status'     => $status,
              'post_type'       => $tca,
              'post_title'      => (string)$ivd['title'],
              'post_content'    => (string)$ivd['desc'],
            );
    
    $post_id = wp_insert_post( $post_args );
    

    And the names of the variables are other, but I copy and paste, there is no writing error. Include the idea is so correct that the code works and the $identif variable comes together perfectly, what could it be?

    Thanks

Viewing 2 replies - 16 through 17 (of 17 total)
  • Moderator bcworkz

    (@bcworkz)

    Great news! Nicely done, very clever ??
    I’m glad I was able to help is some way, but the real solution is entirely your doing. I just pointed out a method of converting data, how to make use of it is all yours ??

    Thread Starter herculesnetwork

    (@herculesnetwork)

    Thanks and Thanks ?? Another day, I will open a topic to see that case, not accept echo of sequences that already exist in array arrays, with 7 digits already previously repeated!
    Cheers ??

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Why the value of a variable is not entering post_content on just one occasion??’ is closed to new replies.