WordPress.org

Making WordPress.org


Ignore:
Timestamp:
08/03/2017 03:19:52 PM (4 years ago)
Author:
Otto42
Message:

Support forums: rm img from quicktags bar, because we don't allow arbitrary images to be hotlinked from the forums. Avoids confusion.

File:
1 edited

Legend:

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

    r5690 r5737  
    5353        // Honor i18n number formatting.
    5454        add_filter( 'bbp_number_format', array( $this, 'number_format_i18n' ), 10, 5 );
     55
     56        // Edit quicktags for reply box
     57        add_filter( 'bbp_get_quicktags_settings', array( $this, 'quicktags_settings' ) );
    5558    }
    5659
     
    478481        return $formatted_number;
    479482    }
     483
     484    /**
     485     * Remove tags from quicktags that don't work for the forums, such as img.
     486     *
     487     * @param array $settings           quicktags settings array
     488     * @return array
     489     */
     490    function quicktags_settings ( $settings ) {
     491
     492        $tags = explode( ',', $settings['buttons'] );
     493        $tags = array_diff( $tags, array('img') );
     494        $settings['buttons'] = implode( ',', $tags );
     495       
     496        return $settings;
     497    }
    480498}
Note: See TracChangeset for help on using the changeset viewer.