Skip to:
Content

BuddyPress.org

Changeset 9288


Ignore:
Timestamp:
12/29/2014 05:13:00 PM (10 years ago)
Author:
djpaul
Message:

Core: add params to functions in the multisite abstraction file.

WordPress Multisite has several functions that aren't present when WordPress is run in single site mode.
To simplify our compatibility with these configurations, BP uses bp-core-wpabstraction.php to declare wrapper versions of the relevant function.

Prior to this commit, we had several of these functions that didn't have the same parameter declarations as the real functions.
This has not caused any compatibility issues with PHP (parameters can be passed to a function that doesn't explicitly require arguments, without error), but is caught by some PHP static analysers, such as scrutinizer-ci.com.

See https://scrutinizer-ci.com/g/buddypress/BuddyPress/inspections/5e580ae2-ae16-4cbc-b191-95b0ce72b112/issues/files/src/bp-blogs/bp-blogs-functions.php?status=new&orderField=path&order=asc for an example report of this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-wpabstraction.php

    r7916 r9288  
    7676         * @see switch_to_blog()
    7777         */
    78         function switch_to_blog() {
     78        function switch_to_blog( $new_blog, $deprecated = null ) {
    7979            return bp_get_root_blog_id();
    8080        }
     
    9494         * @see get_blogs_of_user()
    9595         */
    96         function get_blogs_of_user() {
     96        function get_blogs_of_user( $user_id, $all = false ) {
    9797            return false;
    9898        }
     
    103103         * @see update_blog_status()
    104104         */
    105         function update_blog_status() {
     105        function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
    106106            return true;
    107107        }
Note: See TracChangeset for help on using the changeset viewer.