Home › Forums › General Issues › differentiate between post types on acf/pre_save_post › Reply To: differentiate between post types on acf/pre_save_post
Here is my HTML markup:
<form id="post" class="acf-form" action="" method="post" >
<div style="display:none">
<script type="text/javascript">
acf.o.post_id = "new";
</script>
<input type="hidden" name="acf_nonce" value="4ceed66667" />
<input type="hidden" name="post_id" value="new" />
<input type="hidden" name="return" value="http://localhost:8888/product/submit-product?updated=true" />
<div id="wp-acf_settings-wrap" class="wp-core-ui wp-editor-wrap tmce-active">
<div id="wp-acf_settings-editor-tools" class="wp-editor-tools hide-if-no-js">
<a id="acf_settings-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">Text</a>
<a id="acf_settings-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">Visual</a>
<div id="wp-acf_settings-media-buttons" class="wp-media-buttons"><a href="#" id="insert-media-button" class="button insert-media add_media" data-editor="acf_settings" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a></div>
</div>
<div id="wp-acf_settings-editor-container" class="wp-editor-container"><textarea class="wp-editor-area" rows="20" cols="40" name="acf_settings" id="acf_settings"></textarea></div>
</div>
</div>
<div id="poststuff">
<div id="titlediv">
<div id="titlewrap"><label class="screen-reader-text" id="title-prompt-text" for="title">Enter title here</label><input type="text" name="post_title" size="30" id="title" placeholder="Enter product title here" autocomplete="off"></div>
</div>
<div id="wp-frontendform-wrap" class="wp-core-ui wp-editor-wrap html-active">......
</div>
<div id="acf_75" class="postbox acf_postbox default">......
</div>
<div><input type="hidden" name="post_type" value="products" /></div>
<!-- Submit -->
<div class="field">
<input type="submit" value="Submit" />
</div>
<!-- / Submit -->
</div>
<!-- <div id="poststuff"> -->
</form>
The html_after field is <div><input type="hidden" name="post_type" value="products" /></div>
Thanks.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.