Making WordPress.org

Changeset 3925


Ignore:
Timestamp:
09/01/2016 11:49:49 PM (7 years ago)
Author:
jmdodd
Message:

Support Forums: Enable per-view posting of new topics for plugins and themes.

File:
1 edited

Legend:

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

    r3906 r3925  
    6868            add_action( 'wporg_compat_after_single_view',      array( $this, 'add_topic_form' ) );
    6969            add_action( 'bbp_theme_before_topic_form_content', array( $this, 'add_topic_form_content' ) );
     70            add_filter( 'bbp_current_user_can_access_create_topic_form', array( $this, 'current_user_can_access_create_topic_form' ) );
    7071        }
    7172    }
     
    310311    }
    311312
     313    public function current_user_can_access_create_topic_form( $retval ) {
     314        if ( bbp_is_single_view() && in_array( bbp_get_view_id(), array( $this->compat() ) ) ) {
     315            $retval = bbp_current_user_can_publish_topics();
     316        }
     317        return $retval;
     318    }
     319
    312320    public function topic_post_extras( $topic_id ) {
    313321        if (
Note: See TracChangeset for help on using the changeset viewer.