[wp-trac] [WordPress Trac] #42238: Notice when Rest Comments controler is checking permision for a non existent post type

WordPress Trac noreply at wordpress.org
Sun Nov 24 20:13:05 UTC 2019


#42238: Notice when Rest Comments controler is checking permision for a non
existent post type
-------------------------------------------------+-------------------------
 Reporter:  dragosh635                           |       Owner:
                                                 |  TimothyBlynJacobs
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests good-first-bug      |     Focuses:
  has-patch                                      |
-------------------------------------------------+-------------------------

Comment (by TimothyBlynJacobs):

 Thanks for working on a patch @imani3011!

 Some minor corrections:

 We can just check if the value is non-falsey instead of explicitly
 checking that the value `is_null`. For example:
 https://github.com/WordPress/wordpress-develop/blob/master/src/wp-
 admin/edit.php#L35

 WordPress also has slightly [https://make.wordpress.org/core/handbook
 /best-practices/coding-standards/php/#space-usage different PHP coding
 standards]. So there should be a space around the parentheses.

 Are you interested in [https://make.wordpress.org/core/handbook/testing
 /automated-testing/writing-phpunit-tests/ writing a unit test] to test
 this fix? It could be added to the `WP_Test_REST_Comments_Controller` test
 class.

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


More information about the wp-trac mailing list