
That depends on where you want it to appear. Most of the time when using shortcodes it because you’re putting them in the middle of content in the wysiwyg editor. If it will appear in a specific place, either before or after the content, then I would use PHP. On the other hand, if you need it to be in the middle of the content somewhere then building a shortcode is pretty much the only option.
If you can do it with simple php then this is all you should need and you can even remove the filter to run shortcodes on textarea fields.
echo do_shortcode(get_field('field_name', 'user_'.get_current_user_id()));

Shortcodes do not run on text field, or any type of field, other than a wysiwyg field. In order to do this you need to create a filter. The acf/format_value documentation has en example that deals with what you’re looking for. https://www.advancedcustomfields.com/resources/acfformat_value/
Based on the screenshot, the Location Rule is “Post Type = wysiwyg-widget”.
Widget Block ID = 691
Custom Field Group ID = 687
So with that, the code should look like this:
<?php if( the_field('Industries Widget Blocks', 687) ): ?>
<div class="industries group">
<?php
// vars
$rows = get_field('repeater', 691);
$pagelink = get_sub_field('page_link', 691);
$image = get_sub_field('image', 691);
$title = get_sub_field('title', 691);
?>
<?php if( have_rows('repeater', 691) ): ?>
<?php while( have_rows('repeater', 691) ): the_row(); ?>
<div class="indus col-sm-3">
<p><a href="<?php $pagelink; ?>">
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /><?php echo $title; ?></a></p>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div><!--end container-->
<?php endif; ?><!--end 'repeater' if-->
With that being said, I still cannot get the content to post. I have requested assistance from the plugin developer for further information.
this is the hole code for int….
define( ‘ACF_LITE’ , false );
if(!class_exists(‘acf’)){
// 1. customize ACF path
add_filter(‘acf/settings/path’, ‘my_acf_settings_path’);
function my_acf_settings_path( $path ) {
// update path
$path = get_stylesheet_directory() . ‘/acf/’;
// return
return $path;
}
// 2. customize ACF dir
add_filter(‘acf/settings/dir’, ‘my_acf_settings_dir’);
function my_acf_settings_dir( $dir ) {
// update path
$dir = get_stylesheet_directory_uri() . ‘/acf/’;
// return
return $dir;
}
// 3. Hide ACF field group menu item
add_filter(‘acf/settings/show_admin’, ‘__return_false’);
// 4. Include ACF
include_once( get_stylesheet_directory() . ‘/acf/acf.php’ );
get_template_part( ‘acf’ );
and this is the hole fields code ….
if(function_exists(“register_field_group”))
{
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d9%84%d9%81%d9%8a%d8%af%d9%8a%d9%88’,
‘title’ => ‘الفيديو’,
‘fields’ => array (
array (
‘key’ => ‘field_5744b09bcb066’,
‘label’ => ‘مصدر الفيديو’,
‘name’ => ‘sourse’,
‘type’ => ‘select’,
‘choices’ => array (
‘youtube’ => ‘يوتيوب’,
‘url’ => ‘رابط خارجي’,
‘upload’ => ‘رفع ملف MP4’,
),
‘default_value’ => ‘youtube’,
‘allow_null’ => 0,
‘multiple’ => 0,
),
array (
‘key’ => ‘field_5744b114cb067’,
‘label’ => ‘رابط اليوتيوب’,
‘name’ => ‘youtube’,
‘type’ => ‘text’,
‘instructions’ => ‘<br /> اذ اخترت يوتيوب ادخل الرابط’,
‘default_value’ => ”,
‘placeholder’ => ‘https://www.youtube.com/watch?v=uypi-KGyTMY’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_5744b36acb068’,
‘label’ => ‘رابط الفيديو’,
‘name’ => ‘url’,
‘type’ => ‘text’,
‘instructions’ => ‘<br /> اذ اخترت الرابط ادخل الرابط’,
‘default_value’ => ”,
‘placeholder’ => ‘http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_5744b3b2cb069’,
‘label’ => ‘ارفع الملف’,
‘name’ => ‘upload’,
‘type’ => ‘file’,
‘save_format’ => ‘url’,
‘library’ => ‘all’,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘vedio’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
),
‘options’ => array (
‘position’ => ‘acf_after_title’,
‘layout’ => ‘normal’,
‘hide_on_screen’ => array (
),
),
‘menu_order’ => 0,
));
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d8%b9%d8%af%d8%a7%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d8%b9%d8%b6%d9%88-%d8%a7%d9%84%d8%a7%d8%b6%d8%a7%d9%81%d9%8a%d8%a9’,
‘title’ => ‘اعدادات العضو الاضافية’,
‘fields’ => array (
array (
‘key’ => ‘field_574c5efd71ede’,
‘label’ => ‘صورة العضو’,
‘name’ => ‘avattar’,
‘type’ => ‘image’,
‘save_format’ => ‘url’,
‘preview_size’ => ‘full’,
‘library’ => ‘all’,
),
array (
‘key’ => ‘field_574c5f1e71edf’,
‘label’ => ‘السيرة الزاتية’,
‘name’ => ‘about’,
‘type’ => ‘wysiwyg’,
‘default_value’ => ”,
‘toolbar’ => ‘full’,
‘media_upload’ => ‘yes’,
),
array (
‘key’ => ‘field_574c5f4171ee0’,
‘label’ => ‘رابط فيسبوك’,
‘name’ => ‘رابط_فيسبوك’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘facebook’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c5f5671ee1’,
‘label’ => ‘رابط تويتر’,
‘name’ => ‘رابط_تويتر’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘twitter’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c5f6671ee2’,
‘label’ => ‘رابط جوجل بلس’,
‘name’ => ‘رابط_جوجل_بلس’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘google plus’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c5f7e71ee3’,
‘label’ => ‘رابط يوتيوب’,
‘name’ => ‘رابط_يوتيوب’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘youtube’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c601c42f93’,
‘label’ => ‘رتبة العضو الشرفية’,
‘name’ => ‘رتبة_العضو_الشرفية’,
‘type’ => ‘wysiwyg’,
‘default_value’ => ”,
‘toolbar’ => ‘full’,
‘media_upload’ => ‘yes’,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘ef_user’,
‘operator’ => ‘==’,
‘value’ => ‘all’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
),
‘options’ => array (
‘position’ => ‘normal’,
‘layout’ => ‘no_box’,
‘hide_on_screen’ => array (
),
),
‘menu_order’ => 0,
));
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d8%b9%d8%af%d8%a7%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d9%85%d9%82%d8%a7%d9%84’,
‘title’ => ‘اعدادات المقال’,
‘fields’ => array (
array (
‘key’ => ‘field_574c63d8a640f’,
‘label’ => ‘العنوان الثان’,
‘name’ => ‘sc’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ”,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c63e7a6410’,
‘label’ => ‘اسم الكاتب’,
‘name’ => ‘user_w’,
‘type’ => ‘text’,
‘instructions’ => ‘اتركها فارغه اذ كنت تريد اظهار الكاتب الاساسى ‘,
‘default_value’ => ”,
‘placeholder’ => ”,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘post’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘vedio’,
‘order_no’ => 0,
‘group_no’ => 1,
),
),
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘photo’,
‘order_no’ => 0,
‘group_no’ => 2,
),
),
),
‘options’ => array (
‘position’ => ‘acf_after_title’,
‘layout’ => ‘default’,
‘hide_on_screen’ => array (
),
),
‘menu_order’ => 0,
));
}
Found it. I never realized that the post-type was ‘wysiwyg-editor’.

Glad you worked it out. If you want a “real” solution to your original problem you can find it here:
https://support.advancedcustomfields.com/forums/topic/removing-paragraph-tags-from-wysiwyg-fields/

acf_form() allows setting to only include selected fields, see the fields option https://www.advancedcustomfields.com/resources/acf_form/
To add the acf_form_head() call to a specific template you could do this on the WP get_header hook with a low priority
// include when template is page.php
add_action('get_header', 'include_acf_form_head', 1);
function include_acf_form_head() {
global $template;
$file = substr($template, strrpos($template, '/')+1);
if ($file == 'page.php') {
acf_form_head();
}
}
Your problem is going to be inserting the form into the page without modifying the theme. WP has not hooks, filters or actions that happen in the content area of the page that will allow you to call a function. The closest thing that you’ll get is the_content. Unfortunately, this is run on every WYSIWYG editor.
Another choice, which is new today https://support.advancedcustomfields.com/forums/topic/create-front-end-form-using-shortcode/#post-38293
Hello,
Thank your for your reply.
The modal is in the main page and the content is loaded with an ajax call. I use wordpress ajax :
php :
function load_acf_form_ajax() {
// variables
if (!empty($_POST['fields_key']) && !empty($_POST['user_id'])) {
$fields_key = $_POST['fields_key'];
$user_id = $_POST['user_id'];
// formulaire ACF form
$options = array(
'post_id' => 'user_' . $user_id, // $user_profile,
'fields' => array($fields_key),
'form' => true,
'submit_value' => 'Valider'
);
acf_form($options);
} else {
echo 'erreur';
}
get_template_part('templates/modal-edit-acf');
die();
}
JS :
jQuery.post(
ajaxurl,
{
'action': 'load_acf_form_ajax',
'fields_key': $field_key,
'user_id': <?php echo $user_id_parameter; ?>
},
function (response, status) {
//console.log(response);
$('#modal_content').html(response);
console.log('status : ' + status);
if (status === 'success') {
console.log('acf.do_action');
// acf.do_action('ready', $('#modal_content'));
// acf.do_action('load', $('#modal_content'));
// acf.fields.wysiwyg.initialize();
acf.do_action('append', $('#modal_content'));
// $(document).trigger('acf/setup_fields', $('#modal_content'));
} else {
$('#modal_content').html(status);
}
}
);
Eliot helped me to debug this.
It was simple (i don’t know how i could miss it).
The solution is : trigger the ‘append’ action within the ajax success function after you have appended your HTML
So, now it works but i still have issue with the wysiwyg editor, or the datepicker.
It is due to missing JS files on the page because form is run within an AJAX call.
I know i have to add acf_enqueue_uploader(); but it still doesn’t wok.
Regards,
Sébastien
I have the same issue with the latest version. I’m using tab groups and a bunch of wysiwygs. The first one in the first tab i shown. The rest of them are not. Same error message as above. Happens for Chrome Mac/Win.
Edit: Well, it actually works on 2 out of 7. Seems random.
Edit 2: Turns out you cannot use certain characters in the name. Since it evaluates to an expression. The guys who originally wrote the used “:” in the name, which of course can’t be used as an selector.
Edit 3: Other weird errors has emerged.
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery…:570 Uncaught Error: Syntax error, unrecognized expression: a[href*=#], a[name*=#]
input.min.js?ver=4.4.7:formatted:1323 Uncaught TypeError: Cannot set property 'toolbar1' of undefined
Edit 4: Found the issue the child theme’s main js.
$body.on('click', 'a[href*="#"], a[name*="#"]', function(event) {
...
return false;
}
And tinymce is using a trigger(‘click’) in a few places.
Not sure WHAT someone was thinking writing that code.

I tested this on both ACF 4 & 5 (wasn’t sure what version your using) and the WYSIWYG fields in both are working correctly. More than likely if there is some incompatibility with another plugin or your theme. You should start by deactivating plugins or switching themes to see what is causing the problem. If you can narrow that down there might be something we can do about it.
We have the exact same problem. We are using flex content with wysiwyg and some other fields and the backend is unusable. Scrolling will kill the browser. There is a serious issue with the JS in the ACF version. We are using pro btw.
Could the developers please have a look at this.
At the moment, the plugin is not scalable for bigger, more complex environments. We would love to use ACF for future projects, but this really concerns me.

I have found that you need to be a little careful about how complex you build field groups. On of the sites I build the client needed to ability to add multiple section to page. Each section could have up to 7 WYSIWYG editors. Each of these editors also had various layout controls for borders, padding, font settings, etc. This worked fine at first by then the client added a page with 20 sections, that’s 140 WYSIWYG editors. The update process timed out. There really isn’t a solution unless someone comes up with a way to update all of those fields in the postmeta table in a single query rather than one at a time.
As far as getting information @gecugamo is correct. When using image fields you’re better off returning the ID and then doing the work yourself. ACF building of image objects is a serious drain and can take a long time, especially if you have a lot of custom image sizes.

Hi @carxofa
I believe you can use acf_form() to do it. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/using-acf_form-to-create-a-new-post/.
You can also use the acf/save_post hook to change the post content based on the WYSIWYG field by using the wp_update_post() function. But if you use ACF Pro, you can simply use the “post_content” option.
I hope this helps.
James —
I found the problem; it was in the template.
I was using the generic WordPress function for calling the value of custom fields, which apparently works with just about everything but the wysiwyg editor. I employed this form:
<?php echo get_post_meta($post->ID, 'text', true); ?>
instead of
<?php the_field('text'); ?>
Once I changed it, everything worked fine.
So always assume an ID 10t error when something like this occurs. Thanks for all your help; sorry to have been a time-waster.
Update —
I copied over the wysiwyg.php template to Twenty Fifteen, and activated that theme…and the problem went away. So it apparently isn’t a custom function, since there isn’t one, but one that exists in Twenty Fifteen that doesn’t exist in the custom theme. Do you have any insight into what that might be?

Hi @skd
I believe the WYSIWYG field will add the <p> tags automatically like the WordPress editor. The code I gave you before is used to remove the generated <p> tags, so the result will be something like the issue you have.
It’s possible that you have a custom function that removes the <p> somewhere else. Could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Fifteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.
Thanks!
James —
I set up a page that replicates the problem and explains it at the same time. You can access it here.
Thanks for you help…

That would be beyond what can be done with ACF. You’d need to build a new field type using the ACF WYSIWYG editor for a base https://www.advancedcustomfields.com/resources/creating-a-new-field-type/ and then create custom JavaScript for that field type that would do what you want done https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/. Can it be done, probably, but not easily.
If you don’t want people to edit the field I would actually use a message field where the content of that message field is built using JavaScript that reads the values of the other fields as well as being updated when a change is made to one of the other fields. Still complicated but I think more likely to happen. If you’re interested in this I can point you to some JS that adds custom actions to different types of fields to get you started.
Good suggestion, but I don’t want the entire HTML area to be editable and the HTML content would also need to have some additional JavaScript functionality that I don’t think can be added in with the WYSIWYG field. Make sense?

Is there any reason why a WYSIWYG field will not work for what you want?
Hello, thanks again for this great plugin.
I appear to have the same problem as described. When setting up a WYSIWYG field, I would like to have the text (html) view tab available to the user. I’ve used ACF for many websites in the past years, but have never seen a tab option like the one you mention above (Visual & Text). When I select WYSIWYG as the filed type, I see the option to have a full/basic toolbar as well as the option to show/hid the media button. But I don’t see an option to show/hide the text tab that is normally available in the wordpress text field. Am I missing something?
Thanks for your help.
Hm, ok, I found a solution in completely turning of wptexturize sitewide with:
add_filter( 'run_wptexturize', '__return_false' );
which works but seems a bit heavy handed. In trying to find a way to target the WYSIWYG sub-field more precisely, I found this thread:
https://support.advancedcustomfields.com/forums/topic/remove-wysiwyg-wptexturize-filter/
Which suggests:
remove_filter ('acf_the_content', 'wptexturize');
Which isn’t working for me, I assume potentially because it is a repeater/subfield?
I’m also actually accessing the repeater by simply getting the entire repeater as a variable and accessing the text directly via the array, so I’m even more confused that the text is being filtered. (get_sub_field or the_sub_field result in the same curly quotes, however)

Thanks for the post.
There is actually an ACF add on that offers the ability to customize the WYSIWYG editor styles out of the box.
Please have a look here: https://wordpress.org/plugins/advanced-custom-fields-custom-wysiwyg-styles/

Hi @adser ,
I am not certain I clearly understand the problem you are having.
However, you can edit the wysiwyg field’s toolbar items and be able to show only those that you want them to access.
I hope this helps.

Hi @hbroccoli,
Thanks for the post.
To customize the acf WYSIWYG settings, you will need to hook into either the wysiwyg_tinymce_settings filter or the wysiwyg_quicktags_settings filter.
For more info on adding custom JS to fields, please refer to this topic: https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/
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.