Fatal error: Call to undefined function post_exists()
Web Design & IT Services in Swanage, Poole, Bournemouth and Dorset by Matthew Pond
Tags
The files in wp-admin
are only loaded when you’re in the admin area… when you’re looking at pages or posts those functions aren’t loaded. In that case you’d need to require the file first, so you’d want to do something like this in your function:
if ( ! is_admin() ) { require_once( ABSPATH . 'wp-admin/includes/post.php' ); }