Making WordPress.org


Ignore:
Timestamp:
05/24/2016 05:43:23 AM (10 years ago)
Author:
dd32
Message:

Plugin Directory: Add term translation.

See #1573

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r3225 r3226  
    2424                add_action( 'widgets_init', array( $this, 'register_widgets' ) );
    2525                add_filter( 'post_type_link', array( $this, 'package_link' ), 10, 2 );
    26                 add_filter( 'term_link', array( $this, 'term_link' ), 10, 3 );
     26                add_filter( 'term_link', array( $this, 'term_link' ), 10, 2 );
    2727                add_filter( 'pre_insert_term', array( $this, 'pre_insert_term_prevent' ) );
    2828                add_action( 'pre_get_posts', array( $this, 'use_plugins_in_query' ) );
     
    224224                }
    225225
     226                if ( 'en_US' != get_locale() ) {
     227                        add_filter( 'get_term', array( __NAMESPACE__ . '\i18n', 'translate_term' ) );
     228                }
     229
    226230                // Instantiate our copy of the Jetpack_Search class.
    227231                if ( class_exists( 'Jetpack' ) && ! class_exists( 'Jetpack_Search' ) ) {
     
    363367         * @param string   $termlink The generated term link.
    364368         * @param \WP_Term $term     The term the link is for.
    365          * @param string   $taxonomy The taxonomy the term is in.
    366          */
    367         public function term_link( $termlink, $term, $taxonomy ) {
    368                 if ( 'plugin_business_model' == $taxonomy ) {
     369         */
     370        public function term_link( $termlink, $term ) {
     371                if ( 'plugin_business_model' == $term->taxonomy ) {
    369372                        return false;
    370373                }
    371                 if ( 'plugin_built_for' == $taxonomy ) {
     374                if ( 'plugin_built_for' == $term->taxonomy ) {
    372375                        return $this->package_link( false, $this->get_plugin_post( $term->slug ) );
    373376                }
Note: See TracChangeset for help on using the changeset viewer.