Example #1
0
						<?php 
        if (current_user_can('moderate', bbp_get_reply_id())) {
            ?>

							<?php 
            do_action('bbp_theme_before_reply_form_reply_to');
            ?>

							<p class="form-reply-to">
								<label for="bbp_reply_to"><?php 
            esc_html_e('Reply To:', 'bbpress');
            ?>
</label><br />
								<?php 
            bbp_reply_to_dropdown();
            ?>
							</p>

							<?php 
            do_action('bbp_theme_after_reply_form_reply_to');
            ?>

							<?php 
            do_action('bbp_theme_before_reply_form_status');
            ?>

							<p>
								<label for="bbp_reply_status"><?php 
            esc_html_e('Reply Status:', 'bbpress');
            ?>
Example #2
0
/**
 * Reply metabox
 *
 * The metabox that holds all of the additional reply information
 *
 * @since 2.0.0 bbPress (r2464)
 *
 * @uses bbp_get_topic_post_type() To get the topic post type
 * @uses do_action() Calls 'bbp_reply_metabox'
 */
function bbp_reply_metabox()
{
    // Post ID
    $post_id = get_the_ID();
    $status = get_post_status($post_id);
    // Get some meta
    $reply_topic_id = bbp_get_reply_topic_id($post_id);
    $reply_forum_id = bbp_get_reply_forum_id($post_id);
    $topic_forum_id = bbp_get_topic_forum_id($reply_topic_id);
    /** Status ****************************************************************/
    ?>

	<p>
		<strong class="label"><?php 
    esc_html_e('Status:', 'bbpress');
    ?>
</strong>
		<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php 
    echo esc_attr('auto-draft' === $status ? 'draft' : $status);
    ?>
" />
		<label class="screen-reader-text" for="post_status"><?php 
    esc_html_e('Select what status to give the reply.', 'bbpress');
    ?>
</label>
		<?php 
    bbp_form_reply_status_dropdown(array('select_id' => 'post_status', 'reply_id' => $post_id));
    ?>
	</p>

	<hr />

	<?php 
    /** Forum *****************************************************************/
    // Only allow individual manipulation of reply forum if there is a mismatch
    if ($reply_forum_id !== $topic_forum_id && (current_user_can('edit_others_replies') || current_user_can('moderate'))) {
        ?>

		<p>
			<strong class="label"><?php 
        esc_html_e('Forum:', 'bbpress');
        ?>
</strong>
			<label class="screen-reader-text" for="bbp_forum_id"><?php 
        esc_html_e('Forum', 'bbpress');
        ?>
</label>
			<?php 
        bbp_dropdown(array('post_type' => bbp_get_forum_post_type(), 'selected' => $reply_forum_id, 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC', 'walker' => '', 'exclude' => '', 'select_id' => 'bbp_forum_id', 'options_only' => false, 'show_none' => __('&mdash; No reply &mdash;', 'bbpress'), 'disable_categories' => current_user_can('edit_forums'), 'disabled' => ''));
        ?>
		</p>

	<?php 
    }
    /** Topic *****************************************************************/
    ?>

	<p>
		<strong class="label"><?php 
    esc_html_e('Topic:', 'bbpress');
    ?>
</strong>
		<label class="screen-reader-text" for="parent_id"><?php 
    esc_html_e('Topic', 'bbpress');
    ?>
</label>
		<input name="parent_id" id="bbp_topic_id" type="text" value="<?php 
    echo esc_attr($reply_topic_id);
    ?>
" data-ajax-url="<?php 
    echo esc_url(wp_nonce_url(add_query_arg(array('action' => 'bbp_suggest_topic'), admin_url('admin-ajax.php', 'relative')), 'bbp_suggest_topic_nonce'));
    ?>
" />
	</p>

	<?php 
    /** Reply To **************************************************************/
    ?>

	<p>
		<strong class="label"><?php 
    esc_html_e('Reply To:', 'bbpress');
    ?>
</strong>
		<label class="screen-reader-text" for="bbp_reply_to"><?php 
    esc_html_e('Reply To', 'bbpress');
    ?>
</label>
		<?php 
    bbp_reply_to_dropdown($post_id);
    ?>
	</p>

	<input name="ping_status" type="hidden" id="ping_status" value="open" />

	<?php 
    wp_nonce_field('bbp_reply_metabox_save', 'bbp_reply_metabox');
    do_action('bbp_reply_metabox', $post_id);
}