Hello, I have a postcreate.php file that creates posts automatically. It is located in my theme folder and works.
But I want to use a function (asa_item) from a plugin which does work in files like single.php but not in my postcreate.php.
Hope you can help.
This is the postcreate.php:
<?php require('CENSORED...' . '/wp-load.php'); global $user_ID; <strong>$abcd = asa_item('B005I4WBMI');</strong> $new_post = array( 'post_title' => 'My New Post', 'post_content' => $abcd, 'post_status' => 'publish', 'post_date' => date('Y-m-d H:i:s'), 'post_author' => $user_ID, 'post_type' => 'post', 'post_category' => array(0) ); $post_id = wp_insert_post($new_post); ?>
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.