Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/07/2019 07:40:16 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Statuses: normalize status related functions across post types.

This commit adds 2 missing functions for forum statuses, and relocates all of them to the correct functions.php files for their post types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r6855 r6922  
    18221822 * Return an associative array of available topic statuses
    18231823 *
     1824 * Developers note: these statuses are actually stored as meta data, and
     1825 * Visibilities are stored in post_status.
     1826 *
    18241827 * @since 2.4.0 bbPress (r5059)
    18251828 *
     
    18571860/**
    18581861 * Return an associative array of forum visibility
     1862 *
     1863 * Developers note: these visibilities are actually stored in post_status, and
     1864 * Statuses are stored in meta data.
    18591865 *
    18601866 * @since 2.4.0 bbPress (r5059)
     
    18721878        bbp_get_hidden_status_id()  => _x( 'Hidden',  'Make forum hidden',  'bbpress' )
    18731879    ), $forum_id );
     1880}
     1881
     1882/**
     1883 * Return array of public forum statuses.
     1884 *
     1885 * @since 2.6.0 bbPress (r6921)
     1886 *
     1887 * @return array
     1888 */
     1889function bbp_get_public_forum_statuses() {
     1890    $statuses = array(
     1891        bbp_get_public_status_id()
     1892    );
     1893
     1894    // Filter & return
     1895    return (array) apply_filters( 'bbp_get_public_forum_statuses', $statuses );
     1896}
     1897
     1898/**
     1899 * Return array of non-public forum statuses.
     1900 *
     1901 * @since 2.6.0 bbPress (r6921)
     1902 *
     1903 * @return array
     1904 */
     1905function bbp_get_non_public_forum_statuses() {
     1906    $statuses = array(
     1907        bbp_get_private_status_id(),
     1908        bbp_get_hidden_status_id()
     1909    );
     1910
     1911    // Filter & return
     1912    return (array) apply_filters( 'bbp_get_non_public_forum_statuses', $statuses );
    18741913}
    18751914
     
    21432182        'no_found_rows'          => true
    21442183    ) );
     2184
    21452185    $reply_id = array_shift( $query->posts );
     2186
    21462187    unset( $query );
    21472188
Note: See TracChangeset for help on using the changeset viewer.