Title: ACF Front End Editor
Last modified: September 1, 2016

---

# ACF Front End Editor

 *  Resolved [lewiscornwell](https://wordpress.org/support/users/lewiscornwell/)
 * (@lewiscornwell)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/acf-front-end-editor/)
 * Hello,
 * This is working great within wp-admin which uses the media manager.
 * However, my site allows users to add posts through an Advanced custom fields 
   form. When uploading a media file this way it doesnt fire up the media library.
 * Is there anyway I can generate thumbnails once the admin has approved the post?
   Or, when the post is submitted for review?
 * [https://wordpress.org/plugins/pdf-thumbnails/](https://wordpress.org/plugins/pdf-thumbnails/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [lewiscornwell](https://wordpress.org/support/users/lewiscornwell/)
 * (@lewiscornwell)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582082)
 * I am trying to build a function, but without success!
 *     ```
       function gen_thumb($post_ID){
       	$attachmentId = get_field( "file_upload", $post_ID);
       	generateThumbnail($attachmentId);
       }
       add_action( 'publish_post', 'gen_thumb');
       ```
   
 *  Plugin Author [stianlik](https://wordpress.org/support/users/stianlik/)
 * (@stianlik)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582090)
 * Hi,
 * You can run the generation function manually using [pdf_thumbnails_generate_attachment_metadata](https://plugins.trac.wordpress.org/browser/pdf-thumbnails/trunk/pdf-thumbnails.php#L25).
   E.g.
 *     ```
       function gen_thumb($post_ID){
       	$attachmentId = get_field( "file_upload", $post_ID);
       	pdf_thumbnails_generate_attachment_metadata(null, $attachmentId);
       }
       add_action( 'publish_post', 'gen_thumb');
       ```
   
 * _Note that this function is not part of the official PDF Thumbnails API so it
   may change in the future._
 * EDIT: Changed `$post_ID` to `attachmentId` in sample.
 *  Thread Starter [lewiscornwell](https://wordpress.org/support/users/lewiscornwell/)
 * (@lewiscornwell)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582093)
 * Thank you very much, are you able to tell me if the rest of my function is correct
   as I cannot seem to get it working.
 * Many thanks
 *  Plugin Author [stianlik](https://wordpress.org/support/users/stianlik/)
 * (@stianlik)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582094)
 * Sorry, I should have used `$attachmentId` in the sample, please see the updated
   sample above. Other than that, your function should be correct.
 *  [lunacodes](https://wordpress.org/support/users/lunacodes/)
 * (@lunacodes)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582313)
 * Heya – hope it’s ok that I’m jumping in here… I’m looking at trying out this 
   plugin with ACF.
 * About the function you wrote above: is that just something I’d post into functions.
   php? or is there somewhere else I should be place it?
 *  Plugin Author [stianlik](https://wordpress.org/support/users/stianlik/)
 * (@stianlik)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582314)
 * You can paste the code into functions.php and it should work. However, it would
   be better to do this from a plugin so that the functionality is separate from
   your theme. If you’d like to go with a plugin, you can follow the instructions
   in the [plugin handbook](https://developer.wordpress.org/plugins/the-basics/).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘ACF Front End Editor’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pdf-thumbnails.svg)
 * [PDF Thumbnails](https://wordpress.org/plugins/pdf-thumbnails/)
 * [Support Threads](https://wordpress.org/support/plugin/pdf-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/pdf-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pdf-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pdf-thumbnails/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [stianlik](https://wordpress.org/support/users/stianlik/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/acf-front-end-editor/#post-7582314)
 * Status: resolved