Advanced Custom Fields
[resolved] how do i filter the content for wysiwyg editor?? (3 posts)

  1. guddu1315
    Posted 3 years ago #

    hello how do i filter the content for wysiwyg editor in AFC?

    i need to use the shortcodes for wysiwyg editor in AFC...
    how can i do that.... any one can help me?

    thank you in advance


  2. guddu1315
    Posted 3 years ago #

    got the solution
    write this in your FUNCTION.php

    function my_acf_format_value_for_api($value, $post_id, $field){
    	return str_replace( ']]>', ']]>', apply_filters( 'the_content', $value) );
    function my_on_init(){
    		add_filter('acf/format_value_for_api/type=wysiwyg', 'my_acf_format_value_for_api', 10, 3);
    add_action('init', 'my_on_init');
  3. semblance_er
    Posted 2 years ago #

    Yeah... the issue I picked up is that you can not remove any tag formatting around shortcode in the ACF wysiwyg editor. Then a shortcode won't work.

    @guddu1315 - thanks for your filter!!! It sure did the trick for me!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic