Ticket #6256: patch.6256.diff
File patch.6256.diff, 1.2 KB (added by , 3 years ago) |
---|
-
wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
55 55 56 56 add_filter( 'gp_for_translation_clauses', array( $this, 'allow_searching_for_no_author_translations' ), 10, 3 ); 57 57 58 add_filter( 'gp_warning_discarded', array( $this, 'disable_discarding_some_warnings' ), 10, 5 ); 59 58 60 // Cron. 59 61 add_filter( 'cron_schedules', [ $this, 'register_cron_schedules' ] ); 60 62 add_action( 'init', [ $this, 'register_cron_events' ] ); … … 325 327 } 326 328 327 329 /** 330 * Allow disabling some warnings. 331 * 332 * See https://meta.trac.wordpress.org/ticket/6256 333 */ 334 function disable_discarding_some_warnings( $project_id, $translation_set, $translation, $warning, $user ) { 335 if ( 'placeholders' === $warning ) { 336 GP::$current_route->die_with_error( __( 'This warning cannot be discarded. Please fix the translation.', 'wporg' ) ); 337 } 338 } 339 340 /** 328 341 * Adds a link to view originals in consistency tool. 329 342 * 330 343 * @param array $more_links The links to be output.