[wp-trac] [WordPress Trac] #35693: PHP Warning: implode(): Invalid arguments passed in wp-includes/class-wp-editor.php on line 683

WordPress Trac noreply at wordpress.org
Tue Feb 2 18:04:40 UTC 2016


#35693: PHP Warning: implode(): Invalid arguments passed in wp-includes/class-wp-
editor.php on line 683
--------------------------+-----------------------
 Reporter:  aohipa        |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Editor        |     Version:  4.4.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------
Changes (by aohipa):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 @azaozz Thanks for the quick answer, but I don't think I use it
 incorrectly.
 That's what my filter looks like:
 {{{#!php
 <?php
 add_filter('mce_buttons', function ($aButtons) {
         return [
                 'styleselect',
                 'bold',
                 'italic',
                 'underline',
                 'strikethrough',
                 'bullist',
                 'numlist',
                 'alignleft',
                 'aligncenter',
                 'alignright',
                 'hr',
                 'outdent',
                 'indent',
                 'link',
                 'unlink',
                 'pastetext',
                 'removeformat',
                 'charmap',
                 'undo',
                 'redo'
         ];
 });
 }}}
 I did not want to merge a new array with the existing buttons array and
 rearrange it's items to get the result I want, so I just returned an array
 with the right order. I dont use plugins, that change the MCE
 configuration either.

 The filter seems to work just fine and I can see that by looking at the
 backend. The buttons are there and in the correct order. But I still get
 this warning, everytime wp_editor is executed because anywhere along the
 way the buttons array has been NULL and therefore is not a acceptable
 parameter for implode().

 And even if I was using it wrong, wouldn't it be good to check the input
 for implode before using it?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35693#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list