[wp-trac] [WordPress Trac] #53680: Correct inline documentation about `IMAGETYPE_WEBP` and `IMG_WEBP`

WordPress Trac noreply at wordpress.org
Fri Jul 16 17:07:40 UTC 2021


#53680: Correct inline documentation about `IMAGETYPE_WEBP` and `IMG_WEBP`
----------------------------------------+---------------------
 Reporter:  GaryJ                       |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  5.8.1
Component:  Media                       |     Version:
 Severity:  minor                       |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  docs
----------------------------------------+---------------------

Comment (by SergeyBiryukov):

 Thanks for catching this! Looks like it should be two separate comments:
 {{{
 // IMAGETYPE_WEBP is only defined in PHP 7.1 or later.
 if ( ! defined( 'IMAGETYPE_WEBP' ) ) {
         define( 'IMAGETYPE_WEBP', 18 );
 }

 // IMG_WEBP is only defined in PHP 7.0.10 or later.
 if ( ! defined( 'IMG_WEBP' ) ) {
         define( 'IMG_WEBP', IMAGETYPE_WEBP ); // phpcs:ignore
 PHPCompatibility.Constants.NewConstants.imagetype_webpFound
 }
 }}}

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


More information about the wp-trac mailing list