Creating new forum topics

In earlier sections, we added features to let users create forum topics from the backend as well as through the REST API. However, forum details page is the most important location where users normally view and create topics. So, we need to have the topic creation on top of the topics list or at the bottom of the topics list. Here, we are going to add it to the top of the topics list. Let's implement section 2 of the code:

    <?php if(current_user_can('edit_wpwaf_topics')) { ?>     <?php if($wpwaf_single_topic_data['msg'] !== ''){ ?>        <div class="wpwaf_forum_msg_<?php echo $wpwaf_single_topic_data['msg_status']; ?>"><?php echo $wpwaf_single_topic_data['msg']; ?></div>     <?php } ?>     <div id="wpwaf_create_topics">  <form ...

Get Wordpress Web Application Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.