Changeset 49215 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 10/19/2020 11:37:53 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r49193 r49215 3154 3154 3155 3155 /** 3156 * Adds rel noreferrer and noopenerto all HTML A elements that have a target.3156 * Adds `rel="noopener"` to all HTML A elements that have a target. 3157 3157 * 3158 3158 * @since 5.1.0 3159 * @since 5.6.0 Removed 'noreferrer' relationship. 3159 3160 * 3160 3161 * @param string $text Content that may contain HTML A elements. … … 3189 3190 3190 3191 /** 3191 * Callback to add rel="noreferrer noopener" string to HTML A element. 3192 * 3193 * Will not duplicate existing noreferrer and noopener values 3194 * to prevent from invalidating the HTML. 3192 * Callback to add `rel="noopener"` string to HTML A element. 3193 * 3194 * Will not duplicate an existing 'noopener' value to avoid invalidating the HTML. 3195 3195 * 3196 3196 * @since 5.1.0 3197 * 3198 * @param array $matches Single Match 3199 * @return string HTML A Element with rel noreferrer noopener in addition to any existing values 3197 * @since 5.6.0 Removed 'noreferrer' relationship. 3198 * 3199 * @param array $matches Single match. 3200 * @return string HTML A Element with `rel="noopener"` in addition to any existing values. 3200 3201 */ 3201 3202 function wp_targeted_link_rel_callback( $matches ) { … … 3220 3221 * @param string $link_html The matched content of the link tag including all HTML attributes. 3221 3222 */ 3222 $rel = apply_filters( 'wp_targeted_link_rel', 'noopener noreferrer', $link_html );3223 $rel = apply_filters( 'wp_targeted_link_rel', 'noopener', $link_html ); 3223 3224 3224 3225 // Return early if no rel values to be added or if no actual target attribute.
Note: See TracChangeset
for help on using the changeset viewer.