Plugin Directory

Changeset 762206


Ignore:
Timestamp:
08/26/2013 02:29:56 AM (13 years ago)
Author:
ddean
Message:

Fix bug affecting publishing posts with saved draft settings outside the post editor, and make posts created outside the post editor use default display settings - thanks, Opinynated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bbpress-post-topics/trunk/index.php

    r751131 r762206  
    242242           
    243243            $bbppt_options = $this->get_topic_options_for_post( $post_ID );
    244             $create_topic = ( isset($bbppt_options['enabled']) && $bbppt_options['enabled'] );
     244            $create_topic = ( ! empty( $bbppt_options['enabled'] ) );
    245245            $use_defaults = ( isset( $bbppt_options['use_defaults'] ) && $bbppt_options['use_defaults'] );
    246246           
     
    254254       
    255255            $bbppt_options = $this->get_draft_settings( $post );
    256             $create_topic = ( isset($bbppt_options['enabled']) && $bbppt_options['enabled'] == 'open' );
     256            $create_topic = ( ! empty( $bbppt_options['enabled'] ) );
    257257            $use_defaults = ( isset( $bbppt_options['use_defaults'] ) && $bbppt_options['use_defaults'] );
    258258           
     
    266266           
    267267            $bbppt_options = get_option( 'bbpress_discussion_defaults' );
    268             $create_topic = ( isset($bbppt_options['enabled']) && $bbppt_options['enabled'] == 'on' );
     268            $create_topic = ( ! empty( $bbppt_options['enabled'] ) );
    269269            $use_defaults = true;
     270            $bbppt_options['use_defaults'] = $use_defaults;
    270271           
    271272            bbppt_debug( 'Processing a topic for unattended post ' . $post_ID . ' with the following settings: ' . print_r( $bbppt_options, true ) );
     
    580581        );
    581582       
    582         $ex_options = array_merge( $ex_options, get_option( 'bbpress_discussion_defaults' ) );
     583        $ex_options = wp_parse_args( get_option( 'bbpress_discussion_defaults' ), $ex_options );
    583584       
    584585        $forum_dropdown_options = array(
Note: See TracChangeset for help on using the changeset viewer.