Support » Plugin: OptionTree » [Plugin: OptionTree] "Warning: Missing argument 2…" when filtering textarea

  • Resolved mbiz

    (@mbiz)


    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”.

    http://wordpress.org/extend/plugins/option-tree/

Viewing 1 replies (of 1 total)
  • Plugin Author Derek Herman

    (@valendesigns)

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

    You’re missing a variable in your filter.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: OptionTree] "Warning: Missing argument 2…" when filtering textarea’ is closed to new replies.