[wp-trac] [WordPress Trac] #45708: Allow retrieving adjacent image link markup without echoing it

WordPress Trac noreply at wordpress.org
Fri May 28 20:09:03 UTC 2021


#45708: Allow retrieving adjacent image link markup without echoing it
--------------------------------------+-----------------------------
 Reporter:  flixos90                  |       Owner:  hellofromTonya
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.8
Component:  Media                     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  template
--------------------------------------+-----------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch needs-unit-tests => has-patch has-unit-tests
 * owner:  (none) => hellofromTonya
 * status:  new => assigned


Comment:

 Reviewed the patch and looks good to me. I agree with having separation
 functions for rendering and getting. Why?

 - Saves having to pass a render/echo argument
 - Each function serves a different purpose
 - Follows established patterns such as ` get_the_ID()` + `the_ID()`,
 `the_permalink()` + `get_permalink()`, `get_the_title()` + `the_title()`,
 etc.

 [attachment:"45708.1.diff"] refreshes the patch against the latest,
 updates to 5.8.0, and adds unit tests for each of the functions.

 @antpb this one is ready for review and commit consideration.

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


More information about the wp-trac mailing list