Changeset 6451
- Timestamp:
- 01/28/2018 04:27:38 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
r5601 r6451 43 43 add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) ); 44 44 add_filter( 'body_class', array( $this, 'wporg_add_make_site_body_class' ) ); 45 add_filter( 'gp_translation_row_template_more_links', array( $this, 'add_consistency_tool_link' ), 10, 5 ); 45 46 46 47 // Toolbar. … … 58 59 $this->register_cli_commands(); 59 60 } 61 } 62 63 /** 64 * Adds a link to view originals in consistency tool. 65 * 66 * @param array $more_links The links to be output. 67 * @param GP_Project $project Project object. 68 * @param GP_Locale $locale Locale object. 69 * @param GP_Translation_Set $translation_set Translation Set object. 70 * @param GP_Translation $translation Translation object. 71 */ 72 public function add_consistency_tool_link( $more_links, $project, $locale, $translation_set, $translation ) { 73 $consistency_tool_url = add_query_arg( 74 [ 75 'search' => urlencode( $translation->singular ), 76 'set' => urlencode( $locale->slug . '/' . $translation_set->slug ), 77 ], 78 home_url( '/consistency' ) 79 ); 80 81 $more_links['consistency-tool'] = '<a href="' . esc_url( $consistency_tool_url ) . '">View original in consistency tool</a>'; 82 83 return $more_links; 60 84 } 61 85
Note: See TracChangeset
for help on using the changeset viewer.