WordPress.org

Making WordPress.org

Changeset 4330


Ignore:
Timestamp:
11/06/16 17:01:16 (15 months ago)
Author:
jmdodd
Message:

Support Forums: Move Gravatar suppression to display hooks.

It should be included on Rosetta forums as it is a visual change, not a performance optimization.

Fixes #2001.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r4181 r4330  
    1212        add_filter( 'bbp_get_topic_admin_links', array( $this, 'get_admin_links' ), 10, 3 ); 
    1313        add_filter( 'bbp_get_reply_admin_links', array( $this, 'get_admin_links' ), 10, 3 ); 
     14 
     15        // Gravatar suppression on lists of topics. 
     16        add_filter( 'bbp_after_get_topic_author_link_parse_args', array( $this, 'get_author_link' ) ); 
     17        add_filter( 'bbp_after_get_reply_author_link_parse_args', array( $this, 'get_author_link' ) ); 
    1418 
    1519        // oEmbed. 
     
    3337 
    3438        return $retval; 
     39    } 
     40 
     41    /** 
     42     * Suppress Gravatars on lists of topics. 
     43     */ 
     44    public function get_author_link( $r ) { 
     45        if ( ! bbp_is_single_topic() || bbp_is_topic_edit() ) { 
     46            $r['type'] = 'name'; 
     47        } 
     48        return $r; 
    3549    } 
    3650 
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-performance-optimizations.php

    r4129 r4330  
    1212        // Remove query to get adjacent posts. 
    1313        remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 ); 
    14  
    15         // Gravatar suppression on lists of topics. 
    16         add_filter( 'bbp_after_get_topic_author_link_parse_args', array( $this, 'get_author_link' ) ); 
    17         add_filter( 'bbp_after_get_reply_author_link_parse_args', array( $this, 'get_author_link' ) ); 
    1814 
    1915        // Filters on pre_get_posts. 
     
    3228        add_action( 'wp_ajax_wp-link-ajax', array( $this, 'disable_wp_link_ajax' ), -1 ); 
    3329        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); 
    34     } 
    35  
    36     /** 
    37      * Remove unnecessary Gravatar display on lists of topics. 
    38      */ 
    39     public function get_author_link( $r ) { 
    40         if ( ! bbp_is_single_topic() || bbp_is_topic_edit() ) { 
    41             $r['type'] = 'name'; 
    42         } 
    43         return $r; 
    4430    } 
    4531 
Note: See TracChangeset for help on using the changeset viewer.