Making WordPress.org

Changeset 10908


Ignore:
Timestamp:
04/15/2021 04:13:22 AM (6 years ago)
Author:
dd32
Message:

Support: Remove the forums CPT description to prevent Jetpack using 'bbPress Forums' as the og:description on ​https://wordpress.org/support/forums/

Props vladt.
See ​https://wordpress.slack.com/archives/C02RQC6RW/p1618458794044500

File:
1 edited

Legend:

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

    r10604 r10908  
    7474                // Limit no-replies view to a certain number of days and hide resolved topics.
    7575                add_filter( 'bbp_register_view_no_replies', array( $this, 'limit_no_replies_view' ) );
     76
     77                // Remove the description from the CPT to avoid Jetpack using it as the og:description.
     78                add_filter( 'bbp_register_forum_post_type', array( $this, 'bbp_register_forum_post_type' ) );
    7679
    7780                // Display extra topic fields after content.
    … …  
    887890                // Exclude closed/hidden/spam/etc topics.
    888891                $args['post_status'] = 'publish';
     892
     893                return $args;
     894        }
     895
     896        /**
     897         * Remove the Forum CPT description field to prevent Jetpack using it as the og:description on /forums/.
     898         */
     899        public function bbp_register_forum_post_type( $args ) {
     900                $args['description'] = '';
    889901
    890902                return $args;
Note: See TracChangeset for help on using the changeset viewer.