—
- OR -
—
/>
__('most recent'),
'oldest' => __('oldest')
);
$xreplies_count = isset($bbpress_topic_options['display-extras']['xcount']) ? $bbpress_topic_options['display-extras']['xcount'] : 5;
$xreplies_count_string = '';
$xsort_select_string = '';
/** Build list of display formats, including custom ones */
$display_formats = array(
'topic' => __( 'Entire topic', 'bbpress-post-topics' ),
'replies' => __( 'Replies only', 'bbpress-post-topics' ),
'xreplies' => sprintf(__( 'Only the %s %s %s replies', 'bbpress-post-topics' ),'', $xreplies_count_string, $xsort_select_string ),
'link' => __( 'A link to the topic', 'bbpress-post-topics' )
);
$display_formats = apply_filters( 'bbppt_display_format_options', $display_formats, $the_post->ID );
?>
ID );
/** Restore the original post being edited */
$post = $the_post;
}
/**
* Process the user's bbPress topic selections when the post is saved
*/
function process_topic_option( $post_ID, $post ) {
/** Don't process on AJAX-based auto-drafts */
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
/** Don't process on initial page load auto drafts */
if( $post->post_status == 'auto-draft' )
return;
/** Only process when the post is published */
if( ! in_array( $post->post_status, apply_filters( 'bbppt_eligible_post_status', array( 'publish' ) ) ) )
return;
/** Only process for post types we specify */
if( !in_array( $post->post_type, apply_filters( 'bbppt_eligible_post_types', array( 'post', 'page' ) ) ) ) {
return;
}
/**
* The user requested to use a bbPress topic for discussion
*/
if( isset($_POST['bbpress_topic']) && $_POST['bbpress_topic']['enabled'] == 'open' ) {
$bbppt_options = $_POST['bbpress_topic'];
$use_defaults = isset($bbppt_options['use_defaults']);
if(!function_exists('bbp_has_forums')) {
?>