Changeset 13174
- Timestamp:
- 02/05/2024 10:07:26 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php
r12809 r13174 296 296 if ( is_page( self::SUBMIT_PAGE_SLUG ) && ! empty( $_GET['errors']['fu-disallowed-mime-type'] ) ) { 297 297 // Hook as reasonably late as possible. 298 add_filter( 'the_content', function ( $content ) { 299 add_filter( 'gettext', [ __CLASS__, 'overwrite_fu_strings' ], 10, 3 ); 300 return $content; 301 } ); 298 add_filter( 'the_content', [ __CLASS__, '_overwrite_fu_strings' ] ); 302 299 303 300 // Unhook as early as possible. 304 301 add_action( 'fu_additional_html', function () { remove_filter( 'gettext', [ __CLASS__, 'overwrite_fu_strings' ] ); } ); 305 302 } 303 } 304 305 /** 306 * Hooks `overwrite_fu_strings()` to the 'gettext' filter. 307 * 308 * Note: This should only be used as a callback as late as possible and after checking that 309 * context indicates a string rewrite is likely. 310 * 311 * @param string $content The content. 312 * @return string The content, unchanged. 313 */ 314 public static function _overwrite_fu_strings( $content ) { 315 add_filter( 'gettext', [ __CLASS__, 'overwrite_fu_strings' ], 10, 3 ); 316 return $content; 306 317 } 307 318
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)