Skip to:
Content

bbPress.org

Changeset 7445


Ignore:
Timestamp:
09/07/2026 12:11:23 AM (2 months ago)
Author:
johnjamesjacoby
Message:

Docs: expand bootstrap, admin, and cache documentation.

Document runtime data accessors and missing globals, correct property and return types, and describe the existing cache invalidation and admin helper behavior. This change only updates comments and preserves runtime behavior.

In trunk, for 2.7.

Props shail-mehta.
Fixes #3663.
From ​https://github.com/bbpress/bbPress/pull/40.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r7418 r7445  
    5858
    5959        /**
    60          * @var mixed False when not logged in; WP_User object when logged in.
     60         * @var WP_User|false Current user object after setup; false before setup.
    6161         */
    6262        public $current_user = false;
    … …  
    106106         * @since 2.1.0 bbPress (r3757)
    107107         *
    108          * @staticvar object $instance
     108         * @staticvar bbPress|null $instance Singleton instance, created on first use.
    109109         * @see bbpress()
    110110         * @return bbPress The one true bbPress.
    … …  
    164164         *
    165165         * @since 2.1.0 bbPress (r3951)
     166         *
     167         * @param string $key Runtime data key.
     168         * @return bool Whether the key has a non-null value.
    166169         */
    167170        public function __isset( $key ) {
    … …  
    173176         *
    174177         * @since 2.1.0 bbPress (r3951)
     178         *
     179         * @param string $key Runtime data key.
     180         * @return mixed Stored value, or null if the key is not set.
    175181         */
    176182        public function __get( $key ) {
    … …  
    184190         *
    185191         * @since 2.1.0 bbPress (r3951)
     192         *
     193         * @param string $key   Runtime data key.
     194         * @param mixed  $value Value to store.
    186195         */
    187196        public function __set( $key, $value ) {
    … …  
    193202         *
    194203         * @since 2.3.0 bbPress (r4628)
     204         *
     205         * @param string $key Runtime data key to remove.
    195206         */
    196207        public function __unset( $key ) {
    … …  
    204215         *
    205216         * @since 2.2.0 bbPress (r4252)
     217         *
     218         * @param string $name Name of the inaccessible method.
     219         * @param array  $args Arguments passed to the method.
     220         * @return null
    206221         */
    207222        public function __call( $name = '', $args = array() ) {
    … …  
    624639         *
    625640         * @since 2.0.0 bbPress (r2727)
     641         *
     642         * @global stdClass[] $wp_post_statuses Registered post status objects, keyed by status name.
    626643         */
    627644        public static function register_post_statuses() {
    … …  
    723740
    724741        /**
    725          * Register the topic tag and forum moderator taxonomies.
     742         * Register the topic tag taxonomy.
    726743         *
    727744         * @since 2.0.0 bbPress (r2464) Added bbp_get_topic_tag_tax_id() taxonomy
  • trunk/src/includes/admin/common.php

    r7380 r7445  
    1717 *
    1818 * @since 2.0.0 bbPress (r2957)
     19 *
     20 * @global array $menu WordPress admin menu entries.
    1921 */
    2022function bbp_admin_separator() {
    … …  
    5254 *
    5355 * @param bool $menu_order Menu order.
    54  * @return mixed True if separator, false if not.
     56 * @return bool True when the bbPress separator is shown; otherwise the original value.
    5557 */
    5658function bbp_admin_custom_menu_order( $menu_order = false ) {
    … …  
    120122 * @since 2.6.0 bbPress (r5364)
    121123 *
    122  * @param string $slug
    123  * @return string
     124 * @param string $slug Optional. Permalink slug to sanitize. Default empty.
     125 * @return string Sanitized slug without leading or trailing slashes.
    124126 */
    125127function bbp_sanitize_slug( $slug = '' ) {
    … …  
    157159 * @since 2.1.0 bbPress (r3765)
    158160 *
    159  * @param int $site_id Site id.
     161 * @param int $site_id Optional. Site ID to uninstall. Defaults to the current site.
    160162 */
    161163function bbp_do_uninstall( $site_id = 0 ) {
    … …  
    181183 * @since 2.1.0 bbPress (r3888)
    182184 *
    183  * @global string $plugin_page
    184  * @global array $submenu_file
     185 * @global string $plugin_page  Current plugin admin page.
     186 * @global string $submenu_file Submenu item to highlight.
    185187 */
    186188function bbp_tools_modify_menu_highlight() {
  • trunk/src/includes/core/cache.php

    r7380 r7445  
    8181
    8282        /**
    83          * Skip cache invalidation of related posts if the post ID being invalidated
    84          * is not the one that was just updated.
     83         * Suspend child post cache invalidation after the updated post is cleaned.
     84         *
     85         * The updated post triggers this callback first. Suspending invalidation here
     86         * prevents WordPress from clearing its children during the same update.
    8587         *
    8688         * @since 2.1.0 bbPress (r4011)
     89         *
     90         * @global bool $_wp_suspend_cache_invalidation Whether cache invalidation is suspended.
    8791         *
    8892         * @param int $post_id The post ID of the cache being invalidated.
    … …  
    122126
    123127/**
    124  * Will clean a post in the cache.
     128 * Invalidate parent post caches after a bbPress post cache is cleaned.
    125129 *
    126  * Will call to clean the term object cache associated with the post ID.
     130 * Recurses through parent posts and updates the bbpress_posts last_changed
     131 * cache value when the forum root is reached. Runs on clean_post_cache.
    127132 *
    128133 * @since 2.1.0 bbPress (r4040)
    129134 * @since 2.6.0 bbPress (r6053) Introduced the `$post_id` parameter.
    130135 *
    131  * @param int     $post_id The post id.
    132  * @param WP_Post $post    The WP_Post object.
     136 * @param int     $post_id ID supplied by clean_post_cache. The post object supplies the ID used here.
     137 * @param WP_Post $post    Required post object supplied by clean_post_cache.
    133138 */
    134139function bbp_clean_post_cache( $post_id = null, $post = null ) {
Note: See TracChangeset for help on using the changeset viewer.