I'm updating my plugin to rely on internal functions of WordPress. I'm about to use wp_generate_attachment_metadata
, but this function seems to be only available in the admin section.
Is there an easy was to enable it on the frontend as well?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityPut the following line before using the function.
require_once( ABSPATH . '/wp-admin/includes/image.php' );