Hi, i need to create real cron job, i’m loading wp environment with:
require_once( $parse_uri[0] . 'wp-load.php' ); //$parse_uri[0] = earlier parsed uri, works
and then i’m calling one of my functions after checking if plugin was initialized:
if(in_array( 'omapi/omapi.php', (array) get_option( 'active_plugins', array() ) )) {
require_once(sprintf("%s/omapi-func.php", dirname(__FILE__)));
$omapi = new omapi_Func();
$omapi->get_offers();
}
When i’m launching this from my browser, all works fine, but when server is doing cron job, most works, updating posts, comparing custom fields etc, but it seems script can’t get custom fields registered in options page (registration is hooked to __construct of my main plugin file with add_action('init')
I don’t get what is the problem, i even tried to add check if there is field registered in options and if not i called registration function, but that haven’t changed anything.
After i’m changing cron to wget -q -O
with url instead php
with relative path cron launches correctly, but i want it to be relative.