0

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?

1 Answer 1

1

Put the following line before using the function.

require_once( ABSPATH . '/wp-admin/includes/image.php' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.