Skip to:
Content
Pages
Categories
Search
Top
Bottom

New Topic Form Shortcode Issue


  • mvaneijgen
    Participant

    @mvaneijgen

    ‘Normal’ users get the message “You cannot create new topics.” when you add echo do_shortcode ('[bbp-topic-form]');

    This is a similar topic to this message created almost three years ago, has anyone a solution for the current (latest) version of bbpress and wordpress.

Viewing 8 replies - 1 through 8 (of 8 total)

  • mvaneijgen
    Participant

    @mvaneijgen

    Bump, nobody any solution for this?


    Robkk
    Moderator

    @robkk

    what are you trying to do with the shortcode?

    it should work if you just place [bbp-topic-form] in a page or a sidebar widget like blask studio tinymce widget.


    mvaneijgen
    Participant

    @mvaneijgen

    I do and admins and moderators will see the form and can work with it, but users/subscribers will see the message “You cannot create new topics.” as described here https://bbpress.org/forums/topic/new-topic-form-shortcode-issue/ a topic from almost 3 years ago.

    I place the shortcode in the search result page if there are no instances found of what they are trying to look for, so they can ask that question on the forums.


    mvaneijgen
    Participant

    @mvaneijgen

    Good to know that the spambot does care about my post.


    Robkk
    Moderator

    @robkk

    @mvaneijgen

    i just tested out the shortcode an i get no issues , i checked with a participant and keymaster roles.

    i usually use the topic form page on this site too when i created topics and it seems to work well here too since im a participant.

    Create New Topic

    have you edited the template files specifically the ones for the topic form??
    have you edited role permissions??
    can your users see the message on normal topic forms that should display under a forum list.
    have you done the usual troubleshooting??


    mvaneijgen
    Participant

    @mvaneijgen

    Hey,

    I have edit the feedback-no-search.php inside my child theme stored in child-theme > bbpress
    This is what the file looks like:
    https://gist.github.com/mvaneijgen/83b2bdf325172ae1536b

    No permission changes.
    Yes they can and if I change the short code to [bbp-topic-form forum_id=221] everything works fine
    Don’t know what troubleshooting to try.


    Robkk
    Moderator

    @robkk

    why did you use echo do shortcode on these two lines , they are not shortcodes , its just header text.

    <?php if (!is_user_logged_in()) echo do_shortcode ('<h2 class="mve-form-title">Zo te zien is hierover nog niets geschreven...<br><br>Geregistreerde leden kunnen een vraag stellen aan de community.</h2>') ; ?>

    <?php if (is_user_logged_in()) echo do_shortcode ('<h2 class="mve-form-title">Zo te zien is hierover nog niets geschreven. Stel je vraag aan de community.</h2>') ; ?>

    but the topic you lead to there was a fix , i just edited for your search results page.

    i did test everything out , saw the issue , and resolved it with this function.

    add_filter( 'bbp_current_user_can_access_create_topic_form', 'custom_bbp_access_topic_form' );
    function custom_bbp_access_topic_form( $retval ) {
    
    	if ( bbp_is_search_results() ) {
    		$retval = bbp_current_user_can_publish_topics();
    	}
    
    	return $retval;
    
    }

    mvaneijgen
    Participant

    @mvaneijgen

    Thanks that works.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar