[resolved] "Warning: Missing argument 2..." when filtering textarea (2 posts)

  1. mbiz
    Posted 2 years ago #

    Hi Derek,

    To disable wpautop in textarea, I used the example mentioned on the documentation:

    function filter_textarea_wpautop( $content, $field_id ) {
      if ( $field_id == 'my_textarea' ) {
        return false;
      return $content;
    add_filter( 'ot_wpautop', 'filter_textarea_wpautop', 10, 1 );

    I've changed 'my_textarea' to the ID of my "setting" or "option".

    But the code returns:

    Warning: Missing argument 2 for filter_textarea_wpautop() in C:\Program Files\wamp\www\wp\wp-content\themes\..\functions.php on line 1242

    Likewise, I receive the same error when filtering on tinymce, or media_buttons

    The same happens when filtering "Textarea Simple".


  2. Derek Herman
    Plugin Author

    Posted 2 years ago #

    add_filter( 'ot_wpautop', 'filter_textarea_wpautop', 10, 2 );

    You're missing a variable in your filter.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • OptionTree
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic