Making WordPress.org


Ignore:
Timestamp:
07/12/2018 10:58:07 PM (6 years ago)
Author:
obenland
Message:

Support: Add Create Topic link atop topics list

Hopefully helps avoiding hijacked topics by new users.

Props tobifjellner.
Fixes #3595.

File:
1 edited

Legend:

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

    r6888 r7450  
    1717        add_filter( 'wp_insert_post_data',            array( $this, 'set_post_date_gmt_for_pending_posts' ) );
    1818        add_action( 'wp_print_footer_scripts',        array( $this, 'replace_quicktags_blockquote_button' ) );
     19
     20        // Link to create new topics atop topic list.
     21        add_filter( 'bbp_template_before_pagination_loop', array( $this, 'new_topic_link' ) );
    1922
    2023        // Gravatar suppression on lists of topics and revision logs.
     
    236239
    237240    /**
     241     * Displays a link to the new topic form.
     242     */
     243    public function new_topic_link() {
     244        printf( '<a class="create-topic" href="#new-topic-0">%s</a>', __( 'Create Topic', 'wporg-forums' ) );
     245    }
     246
     247    /**
    238248     * Suppress Gravatars on lists of topics and revision logs.
    239249     */
Note: See TracChangeset for help on using the changeset viewer.