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/topics/functions.php

    r6918 r6922  
    19001900}
    19011901
     1902/**
     1903 * Return array of public topic statuses.
     1904 *
     1905 * @since 2.6.0 bbPress (r6383)
     1906 *
     1907 * @return array
     1908 */
     1909function bbp_get_public_topic_statuses() {
     1910    $statuses = array(
     1911        bbp_get_public_status_id(),
     1912        bbp_get_closed_status_id()
     1913    );
     1914
     1915    // Filter & return
     1916    return (array) apply_filters( 'bbp_get_public_topic_statuses', $statuses );
     1917}
     1918
     1919/**
     1920 * Return array of non-public topic statuses.
     1921 *
     1922 * @since 2.6.0 bbPress (r6642)
     1923 *
     1924 * @return array
     1925 */
     1926function bbp_get_non_public_topic_statuses() {
     1927    $statuses = array(
     1928        bbp_get_trash_status_id(),
     1929        bbp_get_spam_status_id(),
     1930        bbp_get_pending_status_id()
     1931    );
     1932
     1933    // Filter & return
     1934    return (array) apply_filters( 'bbp_get_non_public_topic_statuses', $statuses );
     1935}
     1936
    19021937/** Stickies ******************************************************************/
    19031938
     
    36353670
    36363671    // Statuses to count
    3637     $object_statuses = array(
    3638         bbp_get_public_status_id(),
    3639         bbp_get_closed_status_id()
    3640     );
     3672    $object_statuses = bbp_get_public_topic_statuses();
    36413673
    36423674    // Get database
Note: See TracChangeset for help on using the changeset viewer.