Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/22/2021 03:16:06 AM (3 years ago)
Author:
espellcaste
Message:

Marking deprecated query classes, their methods, arguments as deprecated in the BP_Friends_Friendship and BP_Friends_Friendship classes.

Props imath

Fixes #8554 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/classes/class-bp-friends-friendship.php

    r12459 r13086  
    9898     *
    9999     * @since 1.5.0
     100     * @since 10.0.0 Updated to add deprecated notice for `$is_request`.
    100101     *
    101102     * @param int|null $id                      Optional. The ID of an existing friendship.
    102103     * @param bool     $is_request              Deprecated.
    103      * @param bool     $populate_friend_details True if friend details should be queried.
     104     * @param bool     $populate_friend_details Optional. True if friend details should be queried.
    104105     */
    105106    public function __construct( $id = null, $is_request = false, $populate_friend_details = true ) {
     107
     108        if ( false !== $is_request ) {
     109            _deprecated_argument(
     110                __METHOD__,
     111                '1.5.0',
     112                sprintf(
     113                    /* translators: 1: the name of the method. 2: the name of the file. */
     114                    esc_html__( '%1$s no longer accepts $is_request. See the inline documentation at %2$s for more details.', 'buddypress' ),
     115                    __METHOD__,
     116                    __FILE__
     117                )
     118            );
     119        }
     120
    106121        $this->is_request = $is_request;
    107122
    108         if ( !empty( $id ) ) {
     123        if ( ! empty( $id ) ) {
    109124            $this->id                      = (int) $id;
    110125            $this->populate_friend_details = $populate_friend_details;
Note: See TracChangeset for help on using the changeset viewer.