Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/20/2023 06:34:46 AM (2 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.