I want to ask if there is a hook for executing php inside the admin area, my problem is I'm trying to do the get_posts wordpress function inside a popup frame using the thickbox jQuery plugin, using an anchor, and I linked this anchor to a page contains my code
I do the main function in the functions.php file which is
function fetch_all_companies() {
$companies_args = array(
'numberposts' => -1,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'company',
'post_status' => 'publish'
);
$companies = get_posts($companies_args);
return $companies;}
when executing this function inside the admin panel I got this error
Fatal error: Call to undefined function fetch_all_companies()
any ideas ???