WordPress.org

Making WordPress.org

Changeset 9817


Ignore:
Timestamp:
05/04/2020 02:13:23 AM (19 months ago)
Author:
dd32
Message:

Support Forums: NSFW: Dont' output the <abbr> in the <title> tag.

See #2018.
Fixes #5194.

File:
1 edited

Legend:

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

    r9802 r9817  
    1919
    2020        add_filter( 'bbp_get_topic_title', array( $this, 'prepend_topic_title' ), 10, 2 );
     21
     22        add_filter( 'bbp_title', array( $this, 'strip_abbr_from_title' ) );
    2123
    2224        add_action( 'admin_head', array( $this, 'taxonomy_styles' ) );
     
    198200    }
    199201
     202    /**
     203     * Strip the NSFW abbr tag from the document <title> in a translation-friendly manner.
     204     */
     205    public function strip_abbr_from_title( $title ) {
     206        return preg_replace( '!<abbr title="[^"]+">([^>]+?)</abbr>!i', '$1', $title );
     207    }
    200208}
    201209
Note: See TracChangeset for help on using the changeset viewer.