I had the same problem, to solved I added the plugin: Markdown Extra
And add-on: ACF WordPress Wysiwyg Field
In functions.php I added:
// style editor
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_content', 'wptexturize' );
remove_filter( 'the_excerpt', 'wpautop' );
remove_filter( 'the_excerpt', 'wptexturize' );
remove_filter( 'acf_the_content', 'wpautop' );
remove_filter( 'acf_the_content', 'wptexturize' );
// markdown support
add_filter( 'the_content', 'Markdown' );
add_filter( 'the_excerpt', 'Markdown' );
add_filter( 'acf_the_content', 'Markdown' );
The plugin Typewrite also work for me only offline.
Now I added the plugin: Markdown Extra
And add-on: ACF WordPress Wysiwyg Field
In functions.php I added:
// style editor
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_content', 'wptexturize' );
remove_filter( 'the_excerpt', 'wpautop' );
remove_filter( 'the_excerpt', 'wptexturize' );
remove_filter( 'acf_the_content', 'wpautop' );
remove_filter( 'acf_the_content', 'wptexturize' );
// markdown support
add_filter( 'the_content', 'Markdown' );
add_filter( 'the_excerpt', 'Markdown' );
add_filter( 'acf_the_content', 'Markdown' );
Hi @imarkimage
Thanks for the login.
I just added a WYSIWYG field to the posts post_type and the WYSIWYG renders correctly for both the standard the_content and AF fields.
Have I misunderstood the issue, or has it resolved itself?
Please also update to the latest version of ACF PRO when possible.
Thanks
E
The problem was partially solved, I’ll explain.
Before the fix you sent, the problem occurred as soon as ACF was activated, meaning, even when no WYSIWYG field was present, the editor’s advanced controls were missing.
Now, the problem only occurs when I add the WYSIWYG field and leave the default editor as well:
This is the ACF WYSIWYG field:
And this is the default editor:
As soon as I’ll remove the WYSIWYG field – the advanced controls are back.
Cheers
Elliot,
Seems to have fixed the problem.
Still, when having ACF WYSIWYG field together with the default editor, disables it’s advanced controls.
Thank you!
– Ido
Hi @imarkimage
I have just found and fixed a bug with the WYSIWYG field which I have a feeling may also fix this issue too.
Can you please download the attached file and override the forms/post.php
file?
Thanks
E
Ok 3 days no answer. But I found a solution that seems to have fixed it: https://wordpress.org/support/topic/how-do-i-filter-the-content-for-wysiwyg-editor
I’ve just set up a new installation of WP 3.8 with exactly the same theme and plugin setup and the WYSIWYG is working fine.
I’ll stick with this 3.8 installation for now, but there is obviously an issue to be resolved for v4.
Any updates on this?
I am also getting the same results of ‘Add Media’ and ‘Add Form’ (from Formidable plugin), but not the WYSIWYG toolbar?
I use it to create fields for the easy adding/editing of content all over a website.
I have really only used a few of the field types (text, image, url, text area, wysiwyg and the repeater field)
I used to make a lot of widget based themes before I found ACF. 😛
Just a suggestion, with a large field type like a WYSIWYG editor as one of your repeater sub fields I’d probably set the repeater layout as row instead of table.
If anyone else is looking for a solution to removing <p> tags from around images, in the ACF WYSIWYG editor, just use the following code in your functions:
function filter_ptags_on_acf_images($acfcontent){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(\/a>)?\s*<\/p>/iU', '\1\2\3', $acfcontent);
}
add_filter('acf_the_content', 'filter_ptags_on_images');
Thanks Krendel for the answer.
For current version (I use 5.0.7), you need to use _post_content.
add_filter('acf/get_valid_field/type=wysiwyg', 'my_get_valid_field_post_content');
function my_get_valid_field_post_content( $field )
{
if ( $field['name'] == '_post_content' )
$field['type'] = 'textarea';
return $field;
}
ok i’ve deactivated the plugin and then replaced it with the new one and then reactivated. Now my described WYSIWYG problem is fixed. The one specific field is working again. Coolio!
p.s. @Elliot Condon you can drop and forget my mail i’ve sent to your support mail address one or two day ago about the WYSIWYG issue, your hint here already fixed it 🙂 thanks a lot!
I also have problems with the combination of ACF and VC. When I try to embed media in the WYSIWYG editor, the media doesn’t get inserted into the editor unless I click inside the editor quickly after clicking the blue insert media button in the media library.
I can deal with it, but my customers can’t.
It would be helpful if you could fix it.
I too am having this problem. When I updated to 5.05 my tabs disappeared and the wysiwyg editor lost its icons.
Is there a temporary fix? Where can I download 5.04 in the meantime?
Hi @Jan
Just wanted ot let you know I have added a new setting to the WYSIWYG field which will allow you to enable / disable the html tab!
New version should be out soon.
Cheers
E
In case it helps, here is the code:
Few explanations on what is trying to be achieved:
• The user has a library of images that he uses to build comics. There are 2 repeater fields within one “comic” custom post type: “comic slides” (images within a comic) and “comic_bildkomposition” (layers of images within a slide that will be put into a final image)
• current_timestamp is being used as an ID for each comic that is being built.
• there are 2 repeater fields: “comic_slides” and nested in it there are the fields “comic_text” (wysiwyg field) and “comic_bildkomposition” (repeater field for the image layers within a slide)
CODE:
function lextoons_comic_builder( $ID ) {
$comic_slides = get_field(‘comic_slides’);
// $comic_excerpt = substr(get_field(‘comic_excerpt’), 0, 120);
[Author comment: this was a test in order to see if the function receives acf custom field data at all, which it does, “comic_excerpt” is a custom description field that is being put into the variable and printed just fine
$comic_timestamp = get_field (‘timestamp’);
$current_timestamp = time();
$timestamp_field_key = “field_53da164db054e”;
$comic_title = get_the_title();
//check if comic timestamp has been set yet for this post, set an ID based on timestamp if not
if ($comic_timestamp < 1 ) {
update_field( $timestamp_field_key, $current_timestamp, $ID );
$comic_timestamp = $current_timestamp;
$pathname = “”.$_SERVER[‘DOCUMENT_ROOT’].”wp-content/uploads/comics/”.$comic_timestamp.””;
//print $pathname;
mkdir($pathname);
}
//If an ID has been set before, delete all files in the folder of this comic for recreation afterwards
if ($comic_timestamp > 1 ) {
//echo “<br/>Files: <br/>”;
foreach (glob(“”.$_SERVER[‘DOCUMENT_ROOT’].”wp-content/uploads/comics/”.$comic_timestamp.”/*.*”) as $filename) {
// echo “$filename size ” . filesize($filename) . “<br/>”;
unlink($filename);
}
}
//Now, Loop through all Comic Slides and Generate a single Image out of each slides’ Layer
$slide_nr = 0;
foreach ($comic_slides as $comic_slide) {
$slide_nr++;
$slide_text = $comic_slide[‘comic_text’];
$slide_text = substr($slide_text, 3, -5);
$comic_layers =$comic_slide[‘comic_bildkomposition’];
$width = get_field (‘image_input_width’, ‘options’);
$height = get_field (‘image_input_height’, ‘options’);
$newwidth = get_field (‘image_output_width’, ‘options’);
$newheight = get_field (‘image_output_height’, ‘options’);
$image = imagecreatetruecolor($width, $height);
foreach ($comic_layers as $layer) {
unset ($layer_data);
// to make background transparent
imagealphablending($image, false);
$transparency = imagecolorallocatealpha($image, 0, 0, 0, 127);
imagefill($image, 0, 0, $transparency);
imagesavealpha($image, true);
imagealphablending($image, true);
$layer_url = $layer[‘comic_layer’][‘url’];
print $layer_url;
$layer_data = imagecreatefrompng($layer_url);
imagecopy($image, $layer_data, 0, 0, 0, 0, $width, $height);
imagealphablending($image, false);
imagesavealpha($image, true);
}
$image2 = imagecreatetruecolor($width, $height);
$white = imagecolorallocate($image, 255, 255, 255);
imagefill($image2, 0, 0, $white);
imagecopy($image2, $image, 0, 0, 0, 0, $width, $height);
//create a thumb file img for resizing
$thumb = imagecreatetruecolor($newwidth, $newheight);
imagecopyresized($thumb, $image2, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagepng($thumb, “”.$_SERVER[‘DOCUMENT_ROOT’].”wp-content/uploads/comics/”.$comic_timestamp.”/”.$comic_title.”_”.$slide_nr.”.png”);
unset ($image);
unset ($image2);
unset ($thumb);
}
}
add_action( ‘acf/save_post’, ‘lextoons_comic_builder’, 20 );
[/CODE]
I do have 3.9 installed, this seemed to coincide with when there was a conflict. I also tried to install the Advanced Custom Fields: WP WYSIWYG from Elliot to see if that would help, but unfortunately it did not.
i had the same problem … only on the wysiwyg field like you… i change get_post_custom(); by get_field() and now it’s ok …
Both tests confirmed it was returning the term ID. The first returned 16 and the second returned:
stdClass Object ( [term_id] => 16 [name] => Clothing [slug] => clothing [term_group] => 0 [term_taxonomy_id] => 16 [taxonomy] => product_cat [description] => [parent] => 0 [count] => 12 [filter] => raw )
As for woocommerce support on this particular subject, there isn’t much out there at all, and what I’ve found didn’t work. At the start, it seemed like something I could track down because adding a custom WYSIWYG field above the main woocommerce product loop would allow for a simple way to customize the page content for each product category… but nothing. I even posted the same issue on WooCommerce’s support site and still nothing after 3 days. So strange.
Elliot,
I’ve started a couple new sites already with ACF5 and haven’t had any problems.
I use ACF on these sites to create detailed custom post types that handle image uploads, file attachments, WYSIWYG editors, select fields, date pickers, etc.
I’ve also upgraded a couple sites to ACF 5 and have been happy.
Well I just found this:
https://github.com/elliotcondon/acf-wordpress-wysiwyg-field
Works great. Thanks man!!!!
Hi,
Does
the_field('wysiwyg_field', false, false);
work for sub fields as well? I am trying to use this within a flexible content loop, but with no luck so far. 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.