Changeset 6741
- Timestamp:
- 02/25/2018 04:01:45 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r6451 r6741 3 3 namespace WordPressdotorg\GlotPress\Customizations; 4 4 5 use GP_Translation; 5 6 use WP_CLI; 6 7 … … 44 45 add_filter( 'body_class', array( $this, 'wporg_add_make_site_body_class' ) ); 45 46 add_filter( 'gp_translation_row_template_more_links', array( $this, 'add_consistency_tool_link' ), 10, 5 ); 47 add_filter( 'gp_translation_prepare_for_save', array( $this, 'apply_capital_P_dangit' ), 10, 2 ); 46 48 47 49 // Toolbar. … … 59 61 $this->register_cli_commands(); 60 62 } 63 } 64 65 /** 66 * Applies capital_P_dangit() on translations. 67 * 68 * @param array $args Translation arguments. 69 * @param GP_Translation $translation Translation instance. 70 * @return array Translation arguments. 71 */ 72 public function apply_capital_P_dangit( $args, GP_Translation $translation ) { 73 foreach ( range( 0, $translation->get_static( 'number_of_plural_translations' ) - 1 ) as $i ) { 74 if ( isset( $args[ "translation_$i" ] ) ) { 75 $args[ "translation_$i" ] = capital_P_dangit( $args[ "translation_$i" ] ); 76 } 77 } 78 79 return $args; 61 80 } 62 81
Note: See TracChangeset
for help on using the changeset viewer.