prokops (@prokops)

Forum Replies Created

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

  • prokops
    Participant

    @prokops

    Here is a functions / snippet code version for anyone else looking:

    function my_forums_dropdown_shortcode() {
        // Start buffering output
        ob_start();
    
        // Dropdown container
        echo '<select id="forums-dropdown" onchange="location = this.value;">';
        
        // Forum loop
        if ( bbp_has_forums() ) :
            while ( bbp_forums() ) : bbp_the_forum();
                $forum_permalink = bbp_get_forum_permalink();
                $forum_title = bbp_get_forum_title();
                echo "<option value='{$forum_permalink}'>{$forum_title}</option>";
            endwhile;
        else :
            // No forums found
            bbp_get_template_part( 'feedback', 'no-forums' );
        endif;
    
        // Close the dropdown
        echo '</select>';
    
        // Return the buffer contents
        return ob_get_clean();
    }
    add_shortcode('forums_dropdown', 'my_forums_dropdown_shortcode');
    

    Just paste in [forums_dropdown] where you want output.


    prokops
    Participant

    @prokops

    It would do the trick but it is not the best solution :/
    I will try to develop an submission verification based on user custom field.


    prokops
    Participant

    @prokops

    I can delete the email field in the file you specify. But the forum still tries to validate and thus gives me an “ERROR: Invalid email address.”

    How to define what to validate and disable email field validation?

    Cheers

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