Skip to:
Content

BuddyPress.org

Changeset 13484


Ignore:
Timestamp:
05/20/2023 06:34:46 AM (3 years ago)
Author:
imath
Message:

Improve inline doc, informing about global variable usage in functions

In various xProfile component files, used globals are:

  • $wpdb: the WordPress database object,
  • $profile_template: the xProfile data template object,
  • $group: the current group of profile fields in a loop,
  • $field: the current field in a loop.

Props upadalavipul

Fixes #8890

Location:
trunk/src/bp-xprofile
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r13393 r13484  
    564564 *
    565565 * @since 2.0.0
     566 *
     567 * @global wpdb $wpdb WordPress database object.
    566568 *
    567569 * @access private Do not use.
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r13471 r13484  
    763763 *
    764764 * @since 2.0.0
     765 *
     766 * @global wpdb $wpdb WordPress database object.
    765767 *
    766768 * @param array         $sql   Clauses in the user_id SQL query.
    … …  
    961963 *
    962964 * @since 1.5.0
     965 *
     966 * @global wpdb $wpdb WordPress database object.
    963967 *
    964968 * @param int         $object_id   ID of the object the metadata belongs to.
    … …  
    11421146 *
    11431147 * @since 2.0.0
     1148 *
     1149 * @global wpdb $wpdb WordPress database object.
    11441150 *
    11451151 * @return int Field ID.
    … …  
    14711477 *
    14721478 * @since 8.0.0
     1479 *
     1480 * @global wpdb $wpdb WordPress database object.
    14731481 *
    14741482 * @return int[] The signup field IDs.
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r13443 r13484  
    1919 * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids.
    2020 *
    21  * @global object $profile_template
     21 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
    2222 * @see BP_XProfile_Group::get() for full description of `$args` array.
    2323 *
    … …  
    9999 * @since 1.0.0
    100100 *
     101 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
     102 *
    101103 * @return mixed
    102104 */
    … …  
    111113 * @since 1.0.0
    112114 *
     115 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
     116 *
    113117 * @return mixed
    114118 */
    … …  
    123127 * @since 1.0.0
    124128 *
     129 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
     130 *
    125131 * @return mixed
    126132 */
    … …  
    147153         *
    148154         * @since 1.1.0
     155         *
     156         * @global BP_XProfile_Data_Template $profile_template Profile data template object.
    149157         *
    150158         * @param string|bool $class Extra classes to append to class attribute.
    … …  
    209217 * @since 1.0.0
    210218 *
    211  * @global object $profile_template
     219 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
    212220 *
    213221 * @return mixed
    … …  
    221229         * @since 2.8.0
    222230         *
    223          * @param bool   $value            Whether or not there is data to display.
    224          * @param object $profile_template Profile template object.
    225          * @param string $value            Profile field being displayed.
    226          * @param string $value            Profile field ID being displayed.
     231         * @param bool                      $value            Whether or not there is data to display.
     232         * @param BP_XProfile_Data_Template $profile_template Profile data template object.
     233         * @param string                    $value            Profile field being displayed.
     234         * @param string                    $value            Profile field ID being displayed.
    227235         */
    228236        return apply_filters( 'bp_field_has_data', $profile_template->field_has_data, $profile_template, $profile_template->field, $profile_template->field->id );
    … …  
    234242 * @since 1.0.0
    235243 *
    236  * @global object $profile_template
     244 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
    237245 *
    238246 * @return bool
    … …  
    246254         * @since 2.8.0
    247255         *
    248          * @param bool   $value            Whether or not there is public data to display.
    249          * @param object $profile_template Profile template object.
    250          * @param string $value            Profile field being displayed.
    251          * @param string $value            Profile field ID being displayed.
     256         * @param bool                      $value            Whether or not there is public data to display.
     257         * @param BP_XProfile_Data_Template $profile_template Profile template object.
     258         * @param string                    $value            Profile field being displayed.
     259         * @param string                    $value            Profile field ID being displayed.
    252260         */
    253261        return apply_filters( 'bp_field_has_public_data', ( ! empty( $profile_template->field_has_data ) ), $profile_template, $profile_template->field, $profile_template->field->id );
    … …  
    268276         * @since 1.1.0
    269277         *
     278         * @global object $group Current group of profile fields.
     279         *
    270280         * @return int
    271281         */
    … …  
    297307         * @since 1.0.0
    298308         *
     309         * @global object $group Current group of profile fields.
     310         *
    299311         * @return string
    300312         */
    … …  
    326338         * @since 1.1.0
    327339         *
     340         * @global object $group Current group of profile fields.
     341         *
    328342         * @return string
    329343         */
    … …  
    355369         * @since 1.0.0
    356370         *
     371         * @global object $group Current group of profile fields.
     372         *
    357373         * @return string
    358374         */
    … …  
    383399         *
    384400         * @since 1.1.0
     401         *
     402         * @global object $group Current group of profile fields.
    385403         *
    386404         * @return string
    … …  
    423441         * @since 1.1.0
    424442         *
     443         * @global object $group Current group of profile fields.
     444         *
    425445         * @return string
    426446         */
    … …  
    451471         *
    452472         * @since 2.1.0
     473         *
     474         * @global BP_XProfile_Data_Template $profile_template Profile data template object.
    453475         *
    454476         * @return string
    … …  
    481503 * @since 1.0.0
    482504 *
     505 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
     506 *
    483507 * @return mixed
    484508 */
    … …  
    493517 * @since 1.0.0
    494518 *
     519 * @global BP_XProfile_Data_Template $profile_template Profile data template object.
     520 *
    495521 * @return mixed
    496522 */
    … …  
    514540         * @since 1.1.0
    515541         *
     542         * @global object $field Current profile field.
     543         *
    516544         * @return int
    517545         */
    … …  
    543571         * @since 1.0.0
    544572         *
     573         * @global object $field Current profile field.
     574         *
    545575         * @return string
    546576         */
    … …  
    571601         *
    572602         * @since 1.0.0
     603         *
     604         * @global object $field Current profile field.
    573605         *
    574606         * @return string
    … …  
    605637         * @since 1.1.0
    606638         *
     639         * @global object $field Current profile field.
     640         *
    607641         * @return string
    608642         */
    … …  
    653687         * @since 1.1.0
    654688         *
     689         * @global object $field Current profile field.
     690         *
    655691         * @return string
    656692         */
    … …  
    682718         * @since 1.1.0
    683719         *
     720         * @global object $field Current profile field.
     721         *
    684722         * @return string
    685723         */
    … …  
    710748         *
    711749         * @since 1.1.0
     750         *
     751         * @global object $field Current profile field.
    712752         *
    713753         * @return string
    … …  
    737777 * @since 1.8.0
    738778 *
     779 * @global object $field Current profile field.
     780 *
    739781 * @return string The _errors action name corresponding to this profile field.
    740782 */
    … …  
    760802         * @since 1.1.0
    761803         *
     804         * @global object $field Current profile field.
    762805         *
    763806         * @param array $args {
    … …  
    821864         * @since 1.1.0
    822865         *
     866         * @global object $field Current profile field.
     867         *
    823868         * @return bool
    824869         */
    … …  
    857902         *
    858903         * @since 1.6.0
     904         *
     905         * @global object $field Current profile field.
    859906         *
    860907         * @return string
    … …  
    895942         *
    896943         * @since 1.6.0
     944         *
     945         * @global object $field Current profile field.
    897946         *
    898947         * @return string
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-data-template.php

    r13394 r13484  
    302302         *
    303303         * @since 1.0.0
     304         *
     305         * @global object $group Current group of profile fields.
     306         *
    304307         */
    305308        public function the_profile_group() {
    … …  
    393396         *
    394397         * @since 1.0.0
     398         *
     399         * @global object $field Current profile field.
     400         *
    395401         */
    396402        public function the_profile_field() {
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-wordpress.php

    r13372 r13484  
    156156         *
    157157         * @since 8.0.0
     158         *
     159         * @global wpdb $wpdb WordPress database object.
    158160         *
    159161         * @param integer $user_id The user ID.
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r13469 r13484  
    255255         * @since 2.4.0
    256256         * @since 2.8.0 Added `$user_id` and `$get_data` parameters.
     257         *
     258         * @global wpdb $wpdb WordPress database object.
    257259         *
    258260         * @static
    … …  
    926928         * Get the type for provided field ID.
    927929         *
     930         * @global wpdb $wpdb WordPress database object.
     931         *
    928932         * @param int $field_id Field ID to get type of.
    929933         * @return bool|null|string
    … …  
    10571061         *
    10581062         * @since 2.4.0
     1063         *
     1064         * @global wpdb $wpdb WordPress database object.
    10591065         *
    10601066         * @param string|array $member_types Member type or array of member types. Use 'any' to return unrestricted
Note: See TracChangeset for help on using the changeset viewer.