Skip to:
Content

bbPress.org

Changeset 4169


Ignore:
Timestamp:
08/24/2012 07:49:27 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Bozons:

  • Add bozo post_status and function helper.
  • For 'bozo' capability.
Location:
branches/plugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-functions.php

    r3966 r4169  
    272272function bbp_has_errors() {
    273273
    274     // Assume no errors
    275     $has_errors = false;
    276 
    277274    // Check for errors
    278     if ( bbpress()->errors->get_error_codes() )
    279         $has_errors = true;
     275    $has_errors = bbpress()->errors->get_error_codes() ? true : false;
    280276
    281277    // Filter return value
     
    375371}
    376372
     373/**
     374 * Return the bozo post status ID
     375 *
     376 * @since bbPress (r4167)
     377 *
     378 * @return string
     379 */
     380function bbp_get_bozo_status_id() {
     381    return bbpress()->bozo_status_id;
     382}
     383
    377384/** Rewrite IDs ***************************************************************/
    378385
  • branches/plugin/bbpress.php

    r4164 r4169  
    209209        $this->hidden_status_id  = apply_filters( 'bbp_hidden_post_status',  'hidden'  );
    210210        $this->trash_status_id   = apply_filters( 'bbp_trash_post_status',   'trash'   );
     211        $this->bozo_status_id    = apply_filters( 'bbp_bozo_post_status',    'bozo'    );
    211212
    212213        // Other identifiers
     
    429430        $locale = get_locale();                                          // Default locale
    430431        $locale = apply_filters( 'plugin_locale',  $locale, 'bbpress' ); // Traditional WordPress plugin locale filter
    431         $locale = apply_filters( 'bbpress_locale', $locale );            // bbPress specific locale filter
     432        $locale = apply_filters( 'bbpress_locale', $locale            ); // bbPress specific locale filter
    432433        $mofile = sprintf( 'bbpress-%s.mo', $locale );                   // Get mo file name
    433434
     
    709710        );
    710711
     712        // Bozo
     713        register_post_status(
     714            bbp_get_hidden_status_id(),
     715            apply_filters( 'bbp_register_bozo_post_status', array(
     716                'label'                     => _x( 'Bozo', 'post', 'bbpress' ),
     717                'label_count'               => _nx_noop( 'Bozo <span class="count">(%s)</span>', 'Bozo <span class="count">(%s)</span>', 'bbpress' ),
     718                'private'                   => true,
     719                'exclude_from_search'       => true,
     720                'show_in_admin_status_list' => true,
     721                'show_in_admin_all_list'    => false
     722            ) )
     723        );
     724
    711725        /**
    712726         * Trash fix
Note: See TracChangeset for help on using the changeset viewer.