Why the value of a variable is not entering post_content on just one occasion??
-
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
- The topic ‘Why the value of a variable is not entering post_content on just one occasion??’ is closed to new replies.