Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/23/2017 11:24:29 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Common: Introduce bbp_number_not_negative() and use it in the following ways:

  • Register the relevant meta-data keys for posts & users, so updated values can never be invalid
  • Filter return values for existing database values that might be invalid on existing installs
  • Use in place of intval() or (int) casts where negative values should not exist

This has the added benefit of introducing the bbp_register_meta hook, for future meta-data registrations (of which bbPress has much of.) We'll concentrate on counts for 2.6, and integrate IDs and timestamps in future releases.

See #3059.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/sub-actions.php

    r6106 r6302  
    240240function bbp_register_shortcodes() {
    241241    do_action( 'bbp_register_shortcodes' );
     242}
     243
     244/**
     245 * Register the default bbPress meta-data
     246 *
     247 * @since 2.6.0 bbPress (r46300)
     248 *
     249 * @uses do_action() Calls 'bbp_register_meta'
     250 */
     251function bbp_register_meta() {
     252    do_action( 'bbp_register_meta' );
    242253}
    243254
Note: See TracChangeset for help on using the changeset viewer.