Making WordPress.org


Ignore:
Timestamp:
11/06/2016 05:01:16 PM (10 years 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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.