[wp-trac] [WordPress Trac] #48325: Additional filter in media-template.php. Let developers to hide attachment page link.

WordPress Trac noreply at wordpress.org
Tue Sep 1 05:26:33 UTC 2020


#48325: Additional filter in media-template.php. Let developers to hide attachment
page link.
------------------------------------+-----------------------------
 Reporter:  limera1n                |       Owner:  (none)
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  Future Release
Component:  Media                   |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  ui
------------------------------------+-----------------------------
Changes (by garrett-eclipse):

 * keywords:  has-patch => has-patch dev-feedback


Comment:

 @Mista-Flo great work. Wondering if we need a new filter here though. If
 we just conditionally check for `data.link` before use then users can
 disable using the pre-existing `attachment_link`
 [https://github.com/WordPress/wordpress-
 develop/blob/81a12a7bec6f82bb681176555308335822bd4010/src/wp-includes
 /link-template.php#L451-L459 filter] which lives in the
 `get_attachment_link` used to populate `data.link`. Could update the
 filter docblock to indicate it's now used in this case.

 Most users will want to just disable all or they could conditionally run
 on a screen or post bases.

 P.S. If a new filter is decided to be added then take a look at
 documenting them here;
 https://make.wordpress.org/core/handbook/best-practices/inline-
 documentation-standards/php/#4-hooks-actions-and-filters

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


More information about the wp-trac mailing list