[wp-trac] [WordPress Trac] #55176: if $stickies in function stick_post is not array, it should be empty array

WordPress Trac noreply at wordpress.org
Thu Feb 24 04:38:23 UTC 2022


#55176: if  $stickies in function stick_post is not array, it should be empty array
-------------------------------------------------+-------------------------
 Reporter:  denishua                             |       Owner:
                                                 |  peterwilsoncc
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.0
Component:  Posts, Post Types                    |     Version:  5.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * owner:  (none) => peterwilsoncc
 * status:  new => assigned


Comment:

 Thanks for the tests @azouamauriac.

 So I could ensure the tests were passing, I've created a
 [https://github.com/WordPress/wordpress-develop/pull/2353 pull request] on
 GitHub and linked it to this ticket. This mainly to run the test suite
 before committing.

 It combines [attachment:"55176.4.diff"] and the tests in
 [attachment:"55176.6.diff"] with some minor modifications:

 * data provider removed for deleting the option, it's not needed
 * added tests for various other incorrectly formed options
 * Reduced the changes in `stick_post()` to a single line -- the `if (
 $stickies ) {` line didn't make sense so I had to guess your intent here
 * fixed a couple of minor [https://developer.wordpress.org/coding-
 standards/wordpress-coding-standards/php/ PHP coding standards] issues

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


More information about the wp-trac mailing list