
Hi @tomtids,
Thanks for the post.
There are various plugins in the WP repository that can offer this functionality out if the box.
You can have a look at the following plugin for instance: https://wordpress.org/plugins/advanced-custom-fields-custom-wysiwyg-styles/

Hi @auroric-designs ,
Thanks for the post.
Unfortunately ACF shortcodes cannot be used within other shortcodes.
The API expects the shortcodes to be called from within the WYSIWYG editor and will only work for simple text based values.

Hi @dallasashleyandmalone-com,
Thanks for the post.
Yes this is possible, you will only need to fetch the_content from the wp editor and pass this value to the acf wysiwyg before the value is loaded by hooking into the acf/load_field filter.

Hi @dfoley23,
Thanks for the post.
The description is not very clear, are you referring to the WP editor being hidden or the ACF wysiwyg editor.
The issue might have something to do with how you have set up your location rules, please ensure if you are using a set of location rules to map your fields groups, the appearance of all the templates is covered.
You can also check whether the editor is hidden under the screen options at the top of the page.
sweet, however the issue is actually the_flexible_field(),
get_row_layout() is not finding the layout. i have tried getting ‘repeat_content’ and ‘content_columns’ but neither is working
<?php
while(the_flexible_field('flexible_content')):
echo '<h2>flexi heading</h2>';
switch (get_row_layout()):
case 'repeat_content':
echo '<h2>heading</h2>';
if (function_exists('repeat_content')):
content_columns();
else:
echo 'content col is not enabled';
endif;
break;
case 'includes':
if (function_exists('ml_acf_include')):
ml_acf_include();
else:
echo 'includes is not enabled';
endif;
break;
endswitch;
endwhile;
heres the output of flexible_content
Array
(
[ID] => 0
[key] => field_flex_key
[label] => flexible content
[name] => flexible_content
[prefix] =>
[type] => flexible_content
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => group_56ff5b11d1775
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => flexible_content
[_input] =>
[_valid] => 1
[button_label] => Add Component
[min] =>
[max] =>
[layouts] => Array
(
[0] => Array
(
[key] => layout_key
[name] => layouts
[label] => Components
[display] => block
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_57032097d3ac0
[label] => Content Columns
[name] => content_columns
[prefix] =>
[type] => tab
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => content_columns
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[placement] => top
[endpoint] => 0
)
[1] => Array
(
[ID] => 0
[key] => field_repeatable_key
[label] => Repeatable image with optional link
[name] => repeat_content
[prefix] =>
[type] => repeater
[value] =>
[menu_order] => 1
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => repeat_content
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[row_min] => 0
[row_limit] =>
[layout] => table
[button_label] => Add Component
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_56a749bdc0553
[label] => Content Column
[name] => text_area
[prefix] =>
[type] => wysiwyg
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_repeatable_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => text_area
[_input] =>
[_valid] => 1
[default_value] =>
[tabs] => all
[toolbar] => full
[media_upload] => 1
)
)
[min] => 0
[max] => 0
[collapsed] =>
)
[2] => Array
(
[ID] => 0
[key] => field_styling_tab
[label] => Row Styling
[name] => row_styling
[prefix] =>
[type] => tab
[value] =>
[menu_order] => 2
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => row_styling
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[placement] => top
[endpoint] => 0
)
[3] => Array
(
[ID] => 0
[key] => field_570320bbd3ac1
[label] => row class
[name] => row_class
[prefix] =>
[type] => text
[value] =>
[menu_order] => 3
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => row_class
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[default_value] =>
[placeholder] =>
[prepend] =>
[append] =>
[maxlength] =>
[readonly] => 0
[disabled] => 0
)
[4] => Array
(
[ID] => 0
[key] => field_57031ca0179ba
[label] => boxed content
[name] => boxed_content
[prefix] =>
[type] => true_false
[value] =>
[menu_order] => 4
[instructions] => the width of the content will be limited to the amount set in the stylesheet code.
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => boxed_content
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[message] =>
[default_value] => 1
)
[5] => Array
(
[ID] => 0
[key] => field_57031c64179b9
[label] => invert colors
[name] => invert_colors
[prefix] =>
[type] => true_false
[value] =>
[menu_order] => 5
[instructions] => dark color scheme for this panel instead of a light color scheme
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => invert_colors
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[message] => invert color scheme
[default_value] => 0
)
[6] => Array
(
[ID] => 0
[key] => field_57031b1b179b8
[label] => style options
[name] => style_options
[prefix] =>
[type] => select
[value] =>
[menu_order] => 6
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => style_options
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[choices] => Array
(
[None] => None
[option 1] => option 1
[option 2] => option 2
)
[default_value] => Array
(
)
[allow_null] => 0
[multiple] => 0
[ui] => 0
[ajax] => 0
[placeholder] =>
[disabled] => 0
[readonly] => 0
)
[7] => Array
(
[ID] => 0
[key] => field_57031afc179b7
[label] => bg_image
[name] => bg_image
[prefix] =>
[type] => image
[value] =>
[menu_order] => 7
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_flex_key
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[_name] => bg_image
[_input] =>
[_valid] => 1
[parent_layout] => layout_key
[return_format] => array
[preview_size] => thumbnail
[library] => all
[min_width] =>
[min_height] =>
[min_size] =>
[max_width] =>
[max_height] =>
[max_size] =>
[mime_types] =>
)
)
[min] =>
[max] =>
)
)
)
that is not the issue. the row class needs to be outside of the repeater.
here is what i am trying to replicate with tabs and ‘add local field group’
<?php
acf_add_local_field_group(array (
'key' => 'group_57031a424348c',
'title' => 'content_columns',
'fields' => array (
array (
'key' => 'field_57032097d3ac0',
'label' => 'Content Columns',
'name' => 'content_columns',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'placement' => 'top',
'endpoint' => 0,
),
array (
'key' => 'field_57031a4b179b3',
'label' => 'content columns',
'name' => 'content_columns',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => '',
'max' => '',
'layout' => 'table',
'button_label' => 'Add Content Column',
'sub_fields' => array (
array (
'key' => 'field_5704f37ef4e95',
'label' => 'text_area',
'name' => 'text_area',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'full',
'media_upload' => 1,
),
),
),
array (
'key' => 'field_570320bbd3ac1',
'label' => 'Row Styling',
'name' => 'row_styling',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'placement' => 'top',
'endpoint' => 0,
),
array (
'key' => 'field_57031acc179b6',
'label' => 'row class',
'name' => 'row_class',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
),
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'page',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
));
?>

Hi @emanahan,
Thanks for the post.
Since the WYSIWYG editor already contains a color palette to choose font colors, it is best advised to make use of this functionality which is accessible from the toolbar.

Thanks for the post.
It is possible to modify the dimensions of the WYSIWYG editor by hooking into the acf/input/admin_head action and passing some new styles.
Please have a look at this example:
add_action('acf/input/admin_head', 'lh_acf_admin_head');
function lh_acf_admin_head() {
?>
<style type="text/css">
.acf-field-5639b8dd6170b .acf-editor-wrap iframe {
height: 150px !important;
min-height: 150px;
}
.acf-field-5639b8dd6170b .acf-editor-wrap .mce-fullscreen iframe{
height: 700px !important;
min-height: 700px;
}
</style>
<?php
}

@elliot Is there a possibility to add this as a setting soon as i often find I’m having to add css to do this change manually. More than anything it does’t seem a very suitable solution as due to the complex rendering of the wysiwyg element in most browsers the resizing of the iframe via code such as that shown above only comes into effect a second or so after the page has visibly rendered, resulting in a noticeable change and moving of all content below the field.
Thanks John!
I’d been copying and pasting from a pdf in MAC’s Preview program. It never occurred to me that extraneous markup was stowed away. I should’ve checked the Text view of the WYSIWYG as well.
Glad to know that it was operator error.
–Seth
Thanks John.
James from support also sent me the info below, I’ve forwarded that in to Paul at member press to look at.
“Thanks for the email.
I had a look at the discussion and just to add my input perhaps you could have the guys over at Memberpress also hook into the acf_the_content global filter for getting the acf content within WYSIWYG custom fields.
Please have a look at the following resource page for more info: http://hookr.io/filters/acf_the_content/
I hope this helps.”
Just checked and the default behaviour when using the standard wp wysiwyg is to replace the content with the sign up form.
Ah, interesting point you’ve made there. Is member press redirecting or just replacing the content with the sign up/login.
I may be wrong in thinking its redirecting, I’ll check the page urls.
If the content is in the default wysiwyg wp editor (the_content) it shows the sign up if not logged in.
If the content is in a acf area, nothing happens, it still shows the content (or a blank page if the code I pasted above is used)
I have asked member press to view this thread and let us know their comments.
1 year and 3+ months later….
Hello – I just had this problem with Flexible Content, too. I can’t really see a pattern with it. It occurs on WYSIWYG editors and I get the same markup as mladen.
<div class="page" title="Page 1">
<div class="section">
<div class="layoutArea">
<div class="column">
Does anyone know what’s causing this and how to avoid it?
Thanks,
Seth

Doe the shortcode that you’re adding contain those special quote characters? The reason why I ask is that shortcodes work in acf wysiwyg fields it it’s a valid shortcode and the only reason it shouldn’t be working is that there might be something wrong with the shortcode.

ACF only runs shortcodes on wysiwyg fields by default. In order to let the shortcode be run on another field you need to add a filter for that field and call do_shortcode
http://www.advancedcustomfields.com/resources/acfformat_value/
the filter as I’m using it here is not documented. name and key are later additions.
change acf_field_name to the field name where you want to include the shortcode. You may need to include the post id value in the shortcode you add to the acf field.
http://www.advancedcustomfields.com/resources/shortcode/
add_filter('acf/format_value/name=acf_field_name', 'acf_field_do_shortcodes', 10, 3);
function acf_field_do_shortcodes($value, $post_id, $field) {
if ($value) {
$value = do_shortcode($value);
}
return $value;
}

Hi @wzshop
I’m afraid you can’t do it. Visual Composer has a lot of customized functions that will be hard to duplicate in other sections. You can always create the layout from visual composer and then get the result by changing your editor to the classic text editor. After that, just copy the content to a WYSIWYG field.
I hope this helps.

Hi @jamesjames
Thanks for the question.
You can make use of the wysiwyg_tinymce_settings filter to customize these settings.
The code will look like so:
acf.add_filter('wysiwyg_tinymce_settings', function( mceInit, id ){
// do something to mceInit
// return
return mceInit;
});
I hope this helps.

Hi @manioums
This is weird. I’ve just tried it again on my installation, and the basic uploader setting didn’t load those libraries. Another weird thing is that the WYSIWYG field always loads those libraries, even with the basic setting.
Could you please tell me what ACF version do you use? Also, could you please share the JSON export of your field group so I can test it out on my installation?
Thanks!
Hi @james,
Thank for your answer,
post_content is set to fasle, i do have a WYSIWYG on the page but set to basic.
The problem is not linked to this WYSIWYG basic editor because wheb i remove the Image Field completly, all the WordPress Upload Libray is is not loaded on the page anymore (and my basic WYSIWYG editor is still here).
Can you give me a fix in order to don’t have thoses very big library when the uploader is set to basic ?
Thank again 🙂

Hi @manioums
Did you set the ‘post_content’ option to true or had a WYSIWYG field in the form? If you did, ACF’s need those library to make the WYSIWYG editor works correctly.
If you didn’t have that option or field, those libraries shouldn’t be loaded.
I hope this helps 🙂
Following up on @sdempsey I found that loading pages with large numbers of TinyMCE fields caused the issue. Disabling TinyMCE “fixed” the issue, except that the client isn’t going to be learning HTML to make changes.
I was also able to get the page load, though at an incredibility slow speed, by switching the WYSIWYG fields to Basic.
My current solution is to force the page to load in HTML, then to switch to WYSIWYG after load.
In functions.php, I am adding to @sdempsey code:
function load_custom_wp_admin_style_scripts() {
wp_enqueue_script( 'admin-script', get_template_directory_uri() . '/assets/js/admin.min.js', array( 'jquery' ), '20120202', true );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style_scripts' );
For the admin JS, all I am doing it clicking on all of the Visual switch buttons after the page loads.
jQuery(document).ready( function(){
jQuery('.wp-switch-editor.switch-tmce').click()
});
Not a great solution, but it’s working for now.
Sure thing! So, we have a lot of articles. All of them about films. I want to compile a list of those films, ordered by the first letter of each title. Currently I have it set up as follows:
Underneath the WYSIWYG-editor when writing an article, there’s an ACF for selecting the first letters of each film that appears in the article. When you select the letters, you get text areas into which you type, one row at a time, the names of the films in the text. Example:

Then I use this data to create a page for each letter on the site that looks like this (the letters at the top link to the other pages but are non-functional for the moment until I lock this down):

The code for this page looks like this:
<?php get_header(); ?>
<section class="content">
<?php get_template_part('inc/page-title'); ?>
<div class="pad group">
<div class="entry">
<div class="entry-inner">
<?php the_content(); ?>
<?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>
</div>
<div class="clear"></div>
</div><!--/.entry-->
<?php
$posts = get_posts(array(
'numberposts' => -1,
'meta_key' => 'elokuvat_k',
'order'=> 'ASC',
'orderby' => 'elokuvat_k'
));
if($posts)
{
echo '<ul>';
foreach($posts as $post)
{
echo '<li><a href="' . get_permalink($post->ID) . '">' . get_field($field_name='elokuvat_k', $post->ID) . '</a></li>';
}
echo '</ul>';
}
?>
</div><!--/.pad-->
</section><!--/.content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
This is all good. However, it becomes a problem if an article has two films in it that begin with the same letter. For example, if I add a film like this:

Then it will show up like this on the page:

The problem is that instead of creating two data entries, one of which would be Knock Knock (2015) and the other Kxick Test (2014), it creates a single entity which is known as
Knock Knock (2015)
Kxick Test (2014)
This causes the alphabetical order of that page to become messy, as the lower of these two should be below, in this case, Kummeli V (2014), since it comes later in the alphabet.
I wanted to know if there is any way to make it so that when entering multiple rows of text into the text area -box, the inputs would create their individual values into the database that the code takes them from, ergo instead of creating this single block of content it would create two separate ones.
I just finished reading through this thread and am still having a similar problem today as the one this thread describes. The agency I work for has started using flexible content fields to make our designs modular. Each module typically has it’s own flexible content layout. One such layouts uses a repeater to provide the user with column layouts. Each row of the repeater represents a “column” in that layout. Among the options in each row there is a content field that uses a WYSIWYG.
I noticed page load suffering in a big way the further i got into development. Each time I added a new column layout, each with it’s own set of WYSIWYG Editors, the longer it took to reload/load the page.
In development I was laying out a design that featured several variations of 1, 2, 3, 4 column layouts. In all there are 39 editors on this page causing a page load time of 18+ seconds. I understand this is an extreme case but this is hardly the only layout where WYSIWYG editors are going to be. After a couple hours debugging I came across an old support forum post suggesting that setting the default tab to “text” on the editor might solve the problem. I dug into the codex and learned that there is a filter for doing exactly that.
Solution might be a strong word. I definitely saw an improvement. Using this function i was able to reduce the load time by more than 10s. From an average of 18.41s to 8.37s
//set default tab on WYSIWYG
//return html for the "Text" tab
//return tinymce for "Visual" tab
function tiny_mce_default_tab() {
return 'html';
}
add_filter('wp_default_editor', 'tiny_mce_default_tab');
I hope this will help someone else as frustrated by this issue as I’ve been. If you discover an actual solution to this I would greatly appreciate a reply to this post.
Love,
Sean
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.