Skip to:
Content

BuddyPress.org

Changeset 13493


Ignore:
Timestamp:
05/30/2023 05:56:44 AM (3 years ago)
Author:
imath
Message:

Deprecate all functions having a @todo Deprecate inline comment

Fixes #8909

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r13491 r13493  
    613613
    614614/**
    615  * Output the activities title.
    616  *
    617  * @since 1.0.0
    618  *
    619  * @todo Deprecate.
    620  */
    621 function bp_activities_title() {
    622         echo bp_get_activities_title();
    623 }
    624 
    625         /**
    626          * Return the activities title.
    627          *
    628          * @since 1.0.0
    629          *
    630          * @global string $bp_activity_title
    631          * @todo Deprecate.
    632          *
    633          * @return string The activities title.
    634          */
    635         function bp_get_activities_title() {
    636                 global $bp_activity_title;
    637 
    638                 /**
    639                  * Filters the activities title for the activity template.
    640                  *
    641                  * @since 1.0.0
    642                  *
    643                  * @param string $bp_activity_title The title to be displayed.
    644                  */
    645                 return apply_filters( 'bp_get_activities_title', $bp_activity_title );
    646         }
    647 
    648 /**
    649  * {@internal Missing Description}
    650  *
    651  * @since 1.0.0
    652  *
    653  * @todo Deprecate.
    654  */
    655 function bp_activities_no_activity() {
    656         echo bp_get_activities_no_activity();
    657 }
    658 
    659         /**
    660          * {@internal Missing Description}
    661          *
    662          * @since 1.0.0
    663          *
    664          * @global string $bp_activity_no_activity
    665          * @todo Deprecate.
    666          *
    667          * @return string
    668          */
    669         function bp_get_activities_no_activity() {
    670                 global $bp_activity_no_activity;
    671 
    672                 /**
    673                  * Filters the text used when there is no activity to display.
    674                  *
    675                  * @since 1.0.0
    676                  *
    677                  * @param string $bp_activity_no_activity Text to display for no activity.
    678                  */
    679                 return apply_filters( 'bp_get_activities_no_activity', $bp_activity_no_activity );
    680         }
    681 
    682 /**
    683615 * Output the activity ID.
    684616 *
     
    20511983 * @since 1.2.0
    20521984 *
    2053  * @todo deprecate $args param
    2054  *
    2055  * @param array|string $args See {@link bp_activity_get_comments} for description.
    2056  */
    2057 function bp_activity_comments( $args = '' ) {
    2058         echo bp_activity_get_comments( $args );
     1985 * @param array|string $deprecated See {@link bp_activity_get_comments} for description.
     1986 */
     1987function bp_activity_comments( $deprecated = '' ) {
     1988        // Deprecated notice about $args.
     1989        if ( ! empty( $deprecated ) ) {
     1990                _deprecated_argument(
     1991                        __FUNCTION__,
     1992                        '12.0.0',
     1993                        sprintf(
     1994                                /* translators: 1: the name of the function. 2: the name of the file. */
     1995                                __( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', 'buddypress' ),
     1996                                __FUNCTION__,
     1997                                __FILE__
     1998                        )
     1999                );
     2000        }
     2001
     2002        echo bp_activity_get_comments();
    20592003}
    20602004
     
    20642008         * @since 1.2.0
    20652009         *
    2066          * @todo deprecate $args param
    20672010         * @todo Given that checks for children already happen in bp_activity_recurse_comments(),
    20682011         *       this function can probably be streamlined or removed.
     
    20702013         * @global BP_Activity_Template $activities_template The main activity template loop class.
    20712014         *
    2072          * @param string $args Unused. Left over from an earlier implementation.
     2015         * @param string $deprecated Unused. Left over from an earlier implementation.
    20732016         * @return bool
    20742017         */
    2075         function bp_activity_get_comments( $args = '' ) {
     2018        function bp_activity_get_comments( $deprecated = '' ) {
    20762019                global $activities_template;
     2020
     2021                // Deprecated notice about $args.
     2022                if ( ! empty( $deprecated ) ) {
     2023                        _deprecated_argument(
     2024                                __FUNCTION__,
     2025                                '12.0.0',
     2026                                sprintf(
     2027                                        /* translators: 1: the name of the function. 2: the name of the file. */
     2028                                        __( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', 'buddypress' ),
     2029                                        __FUNCTION__,
     2030                                        __FILE__
     2031                                )
     2032                        );
     2033                }
    20772034
    20782035                if ( empty( $activities_template->activity->children ) ) {
  • trunk/src/bp-core/bp-core-template.php

    r13449 r13493  
    108108
    109109/**
    110  * Get the 'bp_options_title' property from the BP global.
    111  *
    112  * Not currently used in BuddyPress.
    113  *
    114  * @todo Deprecate.
    115  */
    116 function bp_get_options_title() {
    117         $bp = buddypress();
    118 
    119         if ( empty( $bp->bp_options_title ) ) {
    120                 $bp->bp_options_title = __( 'Options', 'buddypress' );
    121         }
    122 
    123         echo apply_filters( 'bp_get_options_title', esc_attr( $bp->bp_options_title ) );
    124 }
    125 
    126 /**
    127110 * Get the directory title for a component.
    128111 *
     
    160143
    161144/** Avatars *******************************************************************/
    162 
    163 /**
    164  * Check to see if there is an options avatar.
    165  *
    166  * An options avatar is an avatar for something like a group, or a friend.
    167  * Basically an avatar that appears in the sub nav options bar.
    168  *
    169  * Not currently used in BuddyPress.
    170  *
    171  * @return bool $value Returns true if an options avatar has been set, otherwise false.
    172  */
    173 function bp_has_options_avatar() {
    174         return (bool) buddypress()->bp_options_avatar;
    175 }
    176 
    177 /**
    178  * Output the options avatar.
    179  *
    180  * Not currently used in BuddyPress.
    181  *
    182  * @todo Deprecate.
    183  */
    184 function bp_get_options_avatar() {
    185         echo apply_filters( 'bp_get_options_avatar', buddypress()->bp_options_avatar );
    186 }
    187 
    188 /**
    189  * Output a comment author's avatar.
    190  *
    191  * Not currently used in BuddyPress.
    192  */
    193 function bp_comment_author_avatar() {
    194         global $comment;
    195 
    196         echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array(
    197                 'item_id' => $comment->user_id,
    198                 'type'    => 'thumb',
    199                 'alt'     => sprintf(
    200                         /* translators: %s: member name */
    201                         __( 'Profile photo of %s', 'buddypress' ),
    202                         bp_core_get_user_displayname( $comment->user_id )
    203                 ),
    204         ) ) );
    205 }
    206 
    207 /**
    208  * Output a post author's avatar.
    209  *
    210  * Not currently used in BuddyPress.
    211  */
    212 function bp_post_author_avatar() {
    213         global $post;
    214 
    215         echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array(
    216                 'item_id' => $post->post_author,
    217                 'type'    => 'thumb',
    218                 'alt'     => sprintf(
    219                         /* translators: %s: member name */
    220                         __( 'Profile photo of %s', 'buddypress' ),
    221                         bp_core_get_user_displayname( $post->post_author )
    222                 ),
    223         ) ) );
    224 }
    225145
    226146/**
     
    317237                return apply_filters( 'bp_get_avatar_to_crop_src', $src );
    318238        }
    319 
    320 /**
    321  * Output the avatar cropper <img> markup.
    322  *
    323  * No longer used in BuddyPress.
    324  *
    325  * @todo Deprecate.
    326  */
    327 function bp_avatar_cropper() {
    328 ?>
    329         <img id="avatar-to-crop" class="avatar" src="<?php echo esc_url( buddypress()->avatar_admin->image ); ?>" />
    330 <?php
    331 }
    332239
    333240/**
     
    494401                }
    495402        }
    496 }
    497 
    498 /**
    499  * Do the 'bp_styles' action, and call wp_print_styles().
    500  *
    501  * No longer used in BuddyPress.
    502  *
    503  * @todo Deprecate.
    504  */
    505 function bp_styles() {
    506         do_action( 'bp_styles' );
    507         wp_print_styles();
    508403}
    509404
     
    709604                return apply_filters( 'bp_get_search_default_text', $default_text, $component );
    710605        }
    711 
    712 /**
    713  * Fire the 'bp_custom_profile_boxes' action.
    714  *
    715  * No longer used in BuddyPress.
    716  *
    717  * @todo Deprecate.
    718  */
    719 function bp_custom_profile_boxes() {
    720         do_action( 'bp_custom_profile_boxes' );
    721 }
    722 
    723 /**
    724  * Fire the 'bp_custom_profile_sidebar_boxes' action.
    725  *
    726  * No longer used in BuddyPress.
    727  *
    728  * @todo Deprecate.
    729  */
    730 function bp_custom_profile_sidebar_boxes() {
    731         do_action( 'bp_custom_profile_sidebar_boxes' );
    732 }
    733606
    734607/**
     
    11281001        add_filter( 'bp_get_total_member_count', 'bp_core_number_format' );
    11291002
    1130 /**
    1131  * Output whether blog signup is allowed.
    1132  *
    1133  * @todo Deprecate. It doesn't make any sense to echo a boolean.
    1134  */
    1135 function bp_blog_signup_allowed() {
    1136         echo bp_get_blog_signup_allowed();
    1137 }
    11381003        /**
    11391004         * Is blog signup allowed?
  • trunk/src/bp-core/deprecated/12.0.php

    r13490 r13493  
    959959 */
    960960function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
     961        _deprecated_function( __FUNCTION__, '12.0.0' );
    961962        global $groups_template;
    962963
     
    10521053        <?php }
    10531054}
     1055
     1056/**
     1057 * Output the activities title.
     1058 *
     1059 * @since 1.0.0
     1060 * @deprecated 12.0.0
     1061 */
     1062function bp_activities_title() {
     1063        _deprecated_function( __FUNCTION__, '12.0.0' );
     1064        echo bp_get_activities_title();
     1065}
     1066
     1067/**
     1068 * Return the activities title.
     1069 *
     1070 * @since 1.0.0
     1071 * @deprecated 12.0.0
     1072 *
     1073 * @global string $bp_activity_title
     1074 *
     1075 * @return string The activities title.
     1076 */
     1077function bp_get_activities_title() {
     1078        _deprecated_function( __FUNCTION__, '12.0.0' );
     1079        global $bp_activity_title;
     1080
     1081        /**
     1082         * Filters the activities title for the activity template.
     1083         *
     1084         * @since 1.0.0
     1085         * @deprecated 12.0.0
     1086         *
     1087         * @param string $bp_activity_title The title to be displayed.
     1088         */
     1089        return apply_filters_deprecated( 'bp_get_activities_title', array( $bp_activity_title ), '12.0.0' );
     1090}
     1091
     1092/**
     1093 * {@internal Missing Description}
     1094 *
     1095 * @since 1.0.0
     1096 * @deprecated 12.0.0
     1097 */
     1098function bp_activities_no_activity() {
     1099        _deprecated_function( __FUNCTION__, '12.0.0' );
     1100        echo bp_get_activities_no_activity();
     1101}
     1102
     1103/**
     1104 * {@internal Missing Description}
     1105 *
     1106 * @since 1.0.0
     1107 * @deprecated 12.0.0
     1108 *
     1109 * @global string $bp_activity_no_activity
     1110 *
     1111 * @return string
     1112 */
     1113function bp_get_activities_no_activity() {
     1114        _deprecated_function( __FUNCTION__, '12.0.0' );
     1115        global $bp_activity_no_activity;
     1116
     1117        /**
     1118         * Filters the text used when there is no activity to display.
     1119         *
     1120         * @since 1.0.0
     1121         * @deprecated 12.0.0
     1122         *
     1123         * @param string $bp_activity_no_activity Text to display for no activity.
     1124         */
     1125        return apply_filters_deprecated( 'bp_get_activities_no_activity', array( $bp_activity_no_activity ), '12.0.0' );
     1126}
     1127
     1128/**
     1129 * Get the 'bp_options_title' property from the BP global.
     1130 *
     1131 * Not currently used in BuddyPress.
     1132 *
     1133 * @deprecated 12.0.0
     1134 */
     1135function bp_get_options_title() {
     1136        _deprecated_function( __FUNCTION__, '12.0.0' );
     1137        $bp = buddypress();
     1138
     1139        if ( empty( $bp->bp_options_title ) ) {
     1140                $bp->bp_options_title = __( 'Options', 'buddypress' );
     1141        }
     1142
     1143        echo apply_filters_deprecated( 'bp_get_options_title', array( esc_attr( $bp->bp_options_title ) ), '12.0.0' );
     1144}
     1145
     1146/**
     1147 * Check to see if there is an options avatar.
     1148 *
     1149 * An options avatar is an avatar for something like a group, or a friend.
     1150 * Basically an avatar that appears in the sub nav options bar.
     1151 *
     1152 * @deprecated 12.0.0
     1153 *
     1154 * @return bool $value Returns true if an options avatar has been set, otherwise false.
     1155 */
     1156function bp_has_options_avatar() {
     1157        _deprecated_function( __FUNCTION__, '12.0.0' );
     1158        return (bool) buddypress()->bp_options_avatar;
     1159}
     1160
     1161/**
     1162 * Output the options avatar.
     1163 *
     1164 * @deprecated 12.0.0
     1165 */
     1166function bp_get_options_avatar() {
     1167        _deprecated_function( __FUNCTION__, '12.0.0' );
     1168        echo apply_filters_deprecated( 'bp_get_options_avatar', array( buddypress()->bp_options_avatar ), '12.0.0' );
     1169}
     1170
     1171/**
     1172 * Output a comment author's avatar.
     1173 *
     1174 * @deprecated 12.0.0
     1175 */
     1176function bp_comment_author_avatar() {
     1177        _deprecated_function( __FUNCTION__, '12.0.0' );
     1178        global $comment;
     1179
     1180        echo apply_filters_deprecated(
     1181                'bp_comment_author_avatar',
     1182                array(
     1183                        bp_core_fetch_avatar(
     1184                                array(
     1185                                        'item_id' => $comment->user_id,
     1186                                        'type'    => 'thumb',
     1187                                        'alt'     => sprintf(
     1188                                                /* translators: %s: member name */
     1189                                                __( 'Profile photo of %s', 'buddypress' ),
     1190                                                bp_core_get_user_displayname( $comment->user_id )
     1191                                        ),
     1192                                )
     1193                        )
     1194                ),
     1195                '12.0.0'
     1196        );
     1197}
     1198
     1199/**
     1200 * Output a post author's avatar.
     1201 *
     1202 * @deprecated 12.0.0
     1203 */
     1204function bp_post_author_avatar() {
     1205        _deprecated_function( __FUNCTION__, '12.0.0' );
     1206        global $post;
     1207
     1208        echo apply_filters_deprecated(
     1209                'bp_post_author_avatar',
     1210                array(
     1211                        bp_core_fetch_avatar(
     1212                                array(
     1213                                        'item_id' => $post->post_author,
     1214                                        'type'    => 'thumb',
     1215                                        'alt'     => sprintf(
     1216                                                /* translators: %s: member name */
     1217                                                __( 'Profile photo of %s', 'buddypress' ),
     1218                                                bp_core_get_user_displayname( $post->post_author )
     1219                                        ),
     1220                                )
     1221                        )
     1222                ),
     1223                '12.0.0'
     1224        );
     1225}
     1226
     1227/**
     1228 * Output the avatar cropper <img> markup.
     1229 *
     1230 * @deprecated 12.0.0
     1231 */
     1232function bp_avatar_cropper() {
     1233        _deprecated_function( __FUNCTION__, '12.0.0' );
     1234?>
     1235        <img id="avatar-to-crop" class="avatar" src="<?php echo esc_url( buddypress()->avatar_admin->image ); ?>" />
     1236<?php
     1237}
     1238
     1239/**
     1240 * Do the 'bp_styles' action, and call wp_print_styles().
     1241 *
     1242 * @deprecated 12.0.0
     1243 */
     1244function bp_styles() {
     1245        _deprecated_function( __FUNCTION__, '12.0.0' );
     1246
     1247        do_action_deprecated( 'bp_styles', array(), '12.0.0' );
     1248        wp_print_styles();
     1249}
     1250
     1251/**
     1252 * Fire the 'bp_custom_profile_boxes' action.
     1253 *
     1254 * No longer used in BuddyPress.
     1255 *
     1256 * @deprecated 12.0.0
     1257 */
     1258function bp_custom_profile_boxes() {
     1259        _deprecated_function( __FUNCTION__, '12.0.0' );
     1260        do_action( 'bp_custom_profile_boxes' );
     1261}
     1262
     1263/**
     1264 * Fire the 'bp_custom_profile_sidebar_boxes' action.
     1265 *
     1266 * No longer used in BuddyPress.
     1267 *
     1268 * @deprecated 12.0.0
     1269 */
     1270function bp_custom_profile_sidebar_boxes() {
     1271        _deprecated_function( __FUNCTION__, '12.0.0' );
     1272        do_action_deprecated( 'bp_custom_profile_sidebar_boxes', arrray(), '12.0.0' );
     1273}
     1274
     1275/**
     1276 * Output whether blog signup is allowed.
     1277 *
     1278 * @deprecated 12.0.0
     1279 */
     1280function bp_blog_signup_allowed() {
     1281        _deprecated_function( __FUNCTION__, '12.0.0' );
     1282        echo bp_get_blog_signup_allowed();
     1283}
     1284
     1285/**
     1286 * Output a block of random friends.
     1287 *
     1288 * No longer used in BuddyPress.
     1289 *
     1290 * @deprecated 12.0.0
     1291 */
     1292function bp_friends_random_friends() {
     1293        _deprecated_function( __FUNCTION__, '12.0.0' );
     1294
     1295        if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) {
     1296                $friend_ids = BP_Friends_Friendship::get_random_friends( bp_displayed_user_id() );
     1297                wp_cache_set( 'friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp' );
     1298        } ?>
     1299
     1300        <div class="info-group">
     1301                <h4>
     1302                        <?php
     1303                        /* translators: %s: member name */
     1304                        bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) );
     1305                        ?>
     1306                        &nbsp;
     1307                        (<?php echo BP_Friends_Friendship::total_friend_count( bp_displayed_user_id() ); ?>)
     1308                        &nbsp;
     1309                        <span>
     1310                                <a href="<?php bp_displayed_user_link( array( bp_get_friends_slug() ) ); ?>">
     1311                                        <?php esc_html_e( 'See All', 'buddypress' ) ?>
     1312                                </a>
     1313                        </span>
     1314                </h4>
     1315
     1316                <?php if ( $friend_ids ) { ?>
     1317
     1318                        <ul class="horiz-gallery">
     1319
     1320                        <?php for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { ?>
     1321
     1322                                <li>
     1323                                        <a href="<?php echo bp_members_get_user_url( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i], 'type' => 'thumb' ) ) ?></a>
     1324                                        <h5><?php echo bp_core_get_userlink($friend_ids[$i]) ?></h5>
     1325                                </li>
     1326
     1327                        <?php } ?>
     1328
     1329                        </ul>
     1330
     1331                <?php } else { ?>
     1332
     1333                        <div id="message" class="info">
     1334                                <p>
     1335                                        <?php
     1336                                        /* translators: %s: member name */
     1337                                        bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) );
     1338                                        ?>
     1339                                </p>
     1340                        </div>
     1341
     1342                <?php } ?>
     1343
     1344                <div class="clear"></div>
     1345        </div>
     1346
     1347<?php
     1348}
     1349
     1350/**
     1351 * Pull up a group of random members, and display some profile data about them.
     1352 *
     1353 * This function is no longer used by BuddyPress core.
     1354 *
     1355 * @deprecated 12.0.0
     1356 *
     1357 * @param int $total_members The number of members to retrieve.
     1358 */
     1359function bp_friends_random_members( $total_members = 5 ) {
     1360        _deprecated_function( __FUNCTION__, '12.0.0' );
     1361
     1362        if ( !$user_ids = wp_cache_get( 'friends_random_users', 'bp' ) ) {
     1363                $user_ids = BP_Core_User::get_users( 'random', $total_members );
     1364                wp_cache_set( 'friends_random_users', $user_ids, 'bp' );
     1365        }
     1366
     1367        ?>
     1368
     1369        <?php if ( $user_ids['users'] ) { ?>
     1370
     1371                <ul class="item-list" id="random-members-list">
     1372
     1373                <?php for ( $i = 0, $count = count( $user_ids['users'] ); $i < $count; ++$i ) { ?>
     1374
     1375                        <li>
     1376                                <a href="<?php echo bp_members_get_user_url( $user_ids['users'][$i]->id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->id, 'type' => 'thumb' ) ) ?></a>
     1377                                <h5><?php echo bp_core_get_userlink( $user_ids['users'][$i]->id ) ?></h5>
     1378
     1379                                <?php if ( bp_is_active( 'xprofile' ) ) { ?>
     1380
     1381                                        <?php $random_data = xprofile_get_random_profile_data( $user_ids['users'][$i]->id, true ); ?>
     1382
     1383                                        <div class="profile-data">
     1384                                                <p class="field-name"><?php echo $random_data[0]->name ?></p>
     1385
     1386                                                <?php echo $random_data[0]->value ?>
     1387
     1388                                        </div>
     1389
     1390                                <?php } ?>
     1391
     1392                                <div class="action">
     1393
     1394                                        <?php if ( bp_is_active( 'friends' ) ) { ?>
     1395
     1396                                                <?php bp_add_friend_button( $user_ids['users'][$i]->id ) ?>
     1397
     1398                                        <?php } ?>
     1399
     1400                                </div>
     1401                        </li>
     1402
     1403                <?php } ?>
     1404
     1405                </ul>
     1406
     1407        <?php } else { ?>
     1408
     1409                <div id="message" class="info">
     1410                        <p><?php _e( "There aren't enough site members to show a random sample just yet.", 'buddypress' ) ?></p>
     1411                </div>
     1412
     1413        <?php } ?>
     1414<?php
     1415}
     1416
     1417/**
     1418 * Display a Friends search form.
     1419 *
     1420 * No longer used in BuddyPress.
     1421 *
     1422 * @deprecated 12.0.0
     1423 */
     1424function bp_friend_search_form() {
     1425        _deprecated_function( __FUNCTION__, '12.0.0' );
     1426        $label        = __( 'Filter Friends', 'buddypress' );
     1427        $friends_slug = bp_get_friends_slug();
     1428        $action       = bp_displayed_user_url(
     1429                array(
     1430                        'single_item_component'        => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ),
     1431                        'single_item_action'           => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ),
     1432                        'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_search', 'search' ) ),
     1433                )
     1434        );
     1435        ?>
     1436
     1437                <form action="<?php echo esc_url( $action ) ?>" id="friend-search-form" method="post">
     1438
     1439                        <label for="friend-search-box" id="friend-search-label"><?php echo esc_html( $label ); ?></label>
     1440                        <input type="search" name="friend-search-box" id="friend-search-box" value="" />
     1441
     1442                        <?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?>
     1443
     1444                        <input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( bp_displayed_user_id() ) ?>" />
     1445
     1446                </form>
     1447
     1448        <?php
     1449}
     1450
     1451/**
     1452 * Output the permalink of a group's Members page.
     1453 *
     1454 * @since 1.0.0
     1455 * @since 10.0.0 Added the `$group` parameter.
     1456 * @deprecated 12.0.0
     1457 *
     1458 * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.
     1459 *                                                Default: false.
     1460 */
     1461function bp_group_all_members_permalink( $group = false ) {
     1462        _deprecated_function( __FUNCTION__, '12.0.0' );
     1463        echo esc_url( bp_get_group_all_members_permalink( $group ) );
     1464}
     1465
     1466/**
     1467 * Return the permalink of the Members page of a group.
     1468 *
     1469 * @since 1.0.0
     1470 * @since 10.0.0 Updated to use `bp_get_group`.
     1471 * @deprecated 12.0.0
     1472 *
     1473 * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.
     1474 *                                                Default: false.
     1475 * @return string
     1476 */
     1477function bp_get_group_all_members_permalink( $group = false ) {
     1478        _deprecated_function( __FUNCTION__, '12.0.0' );
     1479        $path_chunks = bp_groups_get_path_chunks( array( 'members' ) );
     1480        $url         = bp_get_group_url( $group, $path_chunks );
     1481
     1482        /**
     1483         * Filters the permalink of the Members page for a group.
     1484         *
     1485         * @since 1.0.0
     1486         * @since 2.5.0 Added the `$group` parameter.
     1487         * @deprecated 12.0.0
     1488         *
     1489         * @param string          $url   Permalink of the Members page for a group.
     1490         * @param BP_Groups_Group $group The group object.
     1491         */
     1492        return apply_filters_deprecated( 'bp_get_group_all_members_permalink', array( $url, $group ), '12.0.0' );
     1493}
     1494
     1495/**
     1496 * Display a Groups search form.
     1497 *
     1498 * No longer used in BuddyPress.
     1499 *
     1500 * @deprecated 12.0.0
     1501 */
     1502function bp_group_search_form() {
     1503        _deprecated_function( __FUNCTION__, '12.0.0' );
     1504        $label       = __('Filter Groups', 'buddypress');
     1505        $name        = 'group-filter-box';
     1506        $groups_slug = bp_get_groups_slug();
     1507        $action      = bp_displayed_user_url(
     1508                array(
     1509                        'single_item_component'        => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ),
     1510                        'single_item_action'           => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' ),
     1511                        'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_search', 'search' ) ),
     1512                )
     1513        );
     1514
     1515        $search_form_html = '<form action="' . esc_url( $action ) . '" id="group-search-form" method="post">
     1516                <label for="'. $name .'" id="'. $name .'-label">'. esc_html( $label ) .'</label>
     1517                <input type="search" name="'. $name . '" id="'. $name .'" value=""/>
     1518
     1519                '. wp_nonce_field( 'group-filter-box', '_wpnonce_group_filter', true, false ) .'
     1520                </form>';
     1521
     1522        echo apply_filters( 'bp_group_search_form', $search_form_html );
     1523}
     1524
     1525/**
     1526 * Determine whether the displayed user has no groups.
     1527 *
     1528 * No longer used in BuddyPress.
     1529 *
     1530 * @deprecated 12.0.0
     1531 *
     1532 * @return bool True if the displayed user has no groups, otherwise false.
     1533 */
     1534function bp_group_show_no_groups_message() {
     1535        _deprecated_function( __FUNCTION__, '12.0.0' );
     1536
     1537        if ( !groups_total_groups_for_user( bp_displayed_user_id() ) ) {
     1538                return true;
     1539        }
     1540
     1541        return false;
     1542}
     1543
     1544/**
     1545 * Determine whether the current page is a group activity permalink.
     1546 *
     1547 * No longer used in BuddyPress.
     1548 *
     1549 * @deprecated 12.0.0
     1550 *
     1551 * @return bool True if this is a group activity permalink, otherwise false.
     1552 */
     1553function bp_group_is_activity_permalink() {
     1554        _deprecated_function( __FUNCTION__, '12.0.0' );
     1555
     1556        if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) ) {
     1557                return false;
     1558        }
     1559
     1560        return true;
     1561}
     1562
     1563/**
     1564 * Displays group filter titles.
     1565 *
     1566 * @since 1.0.0
     1567 * @deprecated 12.0.0
     1568 */
     1569function bp_groups_filter_title() {
     1570        _deprecated_function( __FUNCTION__, '12.0.0' );
     1571        $current_filter = bp_action_variable( 0 );
     1572
     1573        switch ( $current_filter ) {
     1574                case 'recently-active': default:
     1575                        _e( 'Recently Active', 'buddypress' );
     1576                        break;
     1577                case 'recently-joined':
     1578                        _e( 'Recently Joined', 'buddypress' );
     1579                        break;
     1580                case 'most-popular':
     1581                        _e( 'Most Popular', 'buddypress' );
     1582                        break;
     1583                case 'admin-of':
     1584                        _e( 'Administrator Of', 'buddypress' );
     1585                        break;
     1586                case 'mod-of':
     1587                        _e( 'Moderator Of', 'buddypress' );
     1588                        break;
     1589                case 'alphabetically':
     1590                        _e( 'Alphabetically', 'buddypress' );
     1591                break;
     1592        }
     1593
     1594        do_action_deprecated( 'bp_groups_filter_title', array(), '12.0.0' );
     1595}
     1596
     1597
     1598/**
     1599 * Return the ID of a user, based on user_login.
     1600 *
     1601 * No longer used.
     1602 *
     1603 * @deprecated 12.0.0
     1604 *
     1605 * @param string $user_login user_login of the user being queried.
     1606 * @return int
     1607 */
     1608function bp_core_get_displayed_userid( $user_login ) {
     1609        _deprecated_function( __FUNCTION__, '12.0.0' );
     1610        $id = bp_core_get_userid( $user_login );
     1611
     1612        return apply_filters_deprecated( 'bp_core_get_displayed_userid', array( $id ), '12.0.0' );
     1613}
     1614
     1615/**
     1616 * Fetch every post that is authored by the given user for the current blog.
     1617 *
     1618 * No longer used in BuddyPress.
     1619 *
     1620 * @deprecated 12.0.0
     1621 *
     1622 * @param int $user_id ID of the user being queried.
     1623 * @return array Post IDs.
     1624 */
     1625function bp_core_get_all_posts_for_user( $user_id = 0 ) {
     1626        _deprecated_function( __FUNCTION__, '12.0.0' );
     1627        global $wpdb;
     1628
     1629        if ( empty( $user_id ) ) {
     1630                $user_id = bp_displayed_user_id();
     1631        }
     1632
     1633        $all_posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) );
     1634
     1635        return apply_filters( 'bp_core_get_all_posts_for_user', array( $all_posts ), '12.0.0' );
     1636}
  • trunk/src/bp-friends/bp-friends-template.php

    r13443 r13493  
    6464                return apply_filters( 'bp_get_friends_root_slug', buddypress()->friends->root_slug );
    6565        }
    66 
    67 /**
    68  * Output a block of random friends.
    69  *
    70  * No longer used in BuddyPress.
    71  *
    72  * @todo Deprecate
    73  */
    74 function bp_friends_random_friends() {
    75 
    76         if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) {
    77                 $friend_ids = BP_Friends_Friendship::get_random_friends( bp_displayed_user_id() );
    78                 wp_cache_set( 'friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp' );
    79         } ?>
    80 
    81         <div class="info-group">
    82                 <h4>
    83                         <?php
    84                         /* translators: %s: member name */
    85                         bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) );
    86                         ?>
    87                         &nbsp;
    88                         (<?php echo BP_Friends_Friendship::total_friend_count( bp_displayed_user_id() ); ?>)
    89                         &nbsp;
    90                         <span>
    91                                 <a href="<?php bp_displayed_user_link( array( bp_get_friends_slug() ) ); ?>">
    92                                         <?php esc_html_e( 'See All', 'buddypress' ) ?>
    93                                 </a>
    94                         </span>
    95                 </h4>
    96 
    97                 <?php if ( $friend_ids ) { ?>
    98 
    99                         <ul class="horiz-gallery">
    100 
    101                         <?php for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { ?>
    102 
    103                                 <li>
    104                                         <a href="<?php echo bp_members_get_user_url( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i], 'type' => 'thumb' ) ) ?></a>
    105                                         <h5><?php echo bp_core_get_userlink($friend_ids[$i]) ?></h5>
    106                                 </li>
    107 
    108                         <?php } ?>
    109 
    110                         </ul>
    111 
    112                 <?php } else { ?>
    113 
    114                         <div id="message" class="info">
    115                                 <p>
    116                                         <?php
    117                                         /* translators: %s: member name */
    118                                         bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) );
    119                                         ?>
    120                                 </p>
    121                         </div>
    122 
    123                 <?php } ?>
    124 
    125                 <div class="clear"></div>
    126         </div>
    127 
    128 <?php
    129 }
    130 
    131 /**
    132  * Pull up a group of random members, and display some profile data about them.
    133  *
    134  * This function is no longer used by BuddyPress core.
    135  *
    136  * @todo Deprecate
    137  *
    138  * @param int $total_members The number of members to retrieve.
    139  */
    140 function bp_friends_random_members( $total_members = 5 ) {
    141 
    142         if ( !$user_ids = wp_cache_get( 'friends_random_users', 'bp' ) ) {
    143                 $user_ids = BP_Core_User::get_users( 'random', $total_members );
    144                 wp_cache_set( 'friends_random_users', $user_ids, 'bp' );
    145         }
    146 
    147         ?>
    148 
    149         <?php if ( $user_ids['users'] ) { ?>
    150 
    151                 <ul class="item-list" id="random-members-list">
    152 
    153                 <?php for ( $i = 0, $count = count( $user_ids['users'] ); $i < $count; ++$i ) { ?>
    154 
    155                         <li>
    156                                 <a href="<?php echo bp_members_get_user_url( $user_ids['users'][$i]->id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->id, 'type' => 'thumb' ) ) ?></a>
    157                                 <h5><?php echo bp_core_get_userlink( $user_ids['users'][$i]->id ) ?></h5>
    158 
    159                                 <?php if ( bp_is_active( 'xprofile' ) ) { ?>
    160 
    161                                         <?php $random_data = xprofile_get_random_profile_data( $user_ids['users'][$i]->id, true ); ?>
    162 
    163                                         <div class="profile-data">
    164                                                 <p class="field-name"><?php echo $random_data[0]->name ?></p>
    165 
    166                                                 <?php echo $random_data[0]->value ?>
    167 
    168                                         </div>
    169 
    170                                 <?php } ?>
    171 
    172                                 <div class="action">
    173 
    174                                         <?php if ( bp_is_active( 'friends' ) ) { ?>
    175 
    176                                                 <?php bp_add_friend_button( $user_ids['users'][$i]->id ) ?>
    177 
    178                                         <?php } ?>
    179 
    180                                 </div>
    181                         </li>
    182 
    183                 <?php } ?>
    184 
    185                 </ul>
    186 
    187         <?php } else { ?>
    188 
    189                 <div id="message" class="info">
    190                         <p><?php _e( "There aren't enough site members to show a random sample just yet.", 'buddypress' ) ?></p>
    191                 </div>
    192 
    193         <?php } ?>
    194 <?php
    195 }
    196 
    197 /**
    198  * Display a Friends search form.
    199  *
    200  * No longer used in BuddyPress.
    201  *
    202  * @todo Deprecate
    203  */
    204 function bp_friend_search_form() {
    205         $label        = __( 'Filter Friends', 'buddypress' );
    206         $friends_slug = bp_get_friends_slug();
    207         $action       = bp_displayed_user_url(
    208                 array(
    209                         'single_item_component'        => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug, $friends_slug ),
    210                         'single_item_action'           => bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_my_friends', 'my-friends' ),
    211                         'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $friends_slug . '_search', 'search' ) ),
    212                 )
    213         );
    214         ?>
    215 
    216                 <form action="<?php echo esc_url( $action ) ?>" id="friend-search-form" method="post">
    217 
    218                         <label for="friend-search-box" id="friend-search-label"><?php echo esc_html( $label ); ?></label>
    219                         <input type="search" name="friend-search-box" id="friend-search-box" value="" />
    220 
    221                         <?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?>
    222 
    223                         <input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( bp_displayed_user_id() ) ?>" />
    224 
    225                 </form>
    226 
    227         <?php
    228 }
    22966
    23067/**
  • trunk/src/bp-groups/bp-groups-template.php

    r13490 r13493  
    20782078
    20792079/**
    2080  * Output the permalink of a group's Members page.
    2081  *
    2082  * @since 1.0.0
    2083  * @since 10.0.0 Added the `$group` parameter.
    2084  *
    2085  * @todo Deprecate: this function is not used inside the codebase.
    2086  *
    2087  * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.
    2088  *                                                Default: false.
    2089  */
    2090 function bp_group_all_members_permalink( $group = false ) {
    2091         echo esc_url( bp_get_group_all_members_permalink( $group ) );
    2092 }
    2093         /**
    2094          * Return the permalink of the Members page of a group.
    2095          *
    2096          * @since 1.0.0
    2097          * @since 10.0.0 Updated to use `bp_get_group`.
    2098          *
    2099          * @todo Deprecate: this function is not used inside the codebase.
    2100          *
    2101          * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object.
    2102      *                                                Default: false.
    2103          * @return string
    2104          */
    2105         function bp_get_group_all_members_permalink( $group = false ) {
    2106                 $path_chunks = bp_groups_get_path_chunks( array( 'members' ) );
    2107                 $url         = bp_get_group_url( $group, $path_chunks );
    2108 
    2109                 /**
    2110                  * Filters the permalink of the Members page for a group.
    2111                  *
    2112                  * @since 1.0.0
    2113                  * @since 2.5.0 Added the `$group` parameter.
    2114                  *
    2115                  * @param string          $url   Permalink of the Members page for a group.
    2116                  * @param BP_Groups_Group $group The group object.
    2117                  */
    2118                 return apply_filters( 'bp_get_group_all_members_permalink', $url, $group );
    2119         }
    2120 
    2121 /**
    2122  * Display a Groups search form.
    2123  *
    2124  * No longer used in BuddyPress.
    2125  *
    2126  * @todo Deprecate.
    2127  */
    2128 function bp_group_search_form() {
    2129         $label       = __('Filter Groups', 'buddypress');
    2130         $name        = 'group-filter-box';
    2131         $groups_slug = bp_get_groups_slug();
    2132         $action      = bp_displayed_user_url(
    2133                 array(
    2134                         'single_item_component'        => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug, $groups_slug ),
    2135                         'single_item_action'           => bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_my_groups', 'my-groups' ),
    2136                         'single_item_action_variables' => array( bp_rewrites_get_slug( 'members', 'member_' . $groups_slug . '_search', 'search' ) ),
    2137                 )
    2138         );
    2139 
    2140         $search_form_html = '<form action="' . esc_url( $action ) . '" id="group-search-form" method="post">
    2141                 <label for="'. $name .'" id="'. $name .'-label">'. esc_html( $label ) .'</label>
    2142                 <input type="search" name="'. $name . '" id="'. $name .'" value=""/>
    2143 
    2144                 '. wp_nonce_field( 'group-filter-box', '_wpnonce_group_filter', true, false ) .'
    2145                 </form>';
    2146 
    2147         echo apply_filters( 'bp_group_search_form', $search_form_html );
    2148 }
    2149 
    2150 /**
    2151  * Determine whether the displayed user has no groups.
    2152  *
    2153  * No longer used in BuddyPress.
    2154  *
    2155  * @todo Deprecate.
    2156  *
    2157  * @return bool True if the displayed user has no groups, otherwise false.
    2158  */
    2159 function bp_group_show_no_groups_message() {
    2160         if ( !groups_total_groups_for_user( bp_displayed_user_id() ) ) {
    2161                 return true;
    2162         }
    2163 
    2164         return false;
    2165 }
    2166 
    2167 /**
    2168  * Determine whether the current page is a group activity permalink.
    2169  *
    2170  * No longer used in BuddyPress.
    2171  *
    2172  * @todo Deprecate.
    2173  *
    2174  * @return bool True if this is a group activity permalink, otherwise false.
    2175  */
    2176 function bp_group_is_activity_permalink() {
    2177 
    2178         if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) ) {
    2179                 return false;
    2180         }
    2181 
    2182         return true;
    2183 }
    2184 
    2185 /**
    21862080 * Output the pagination HTML for a group loop.
    21872081 *
     
    54955389
    54965390/**
    5497  * Displays group filter titles.
    5498  *
    5499  * @since 1.0.0
    5500  *
    5501  * @todo Deprecate?
    5502  */
    5503 function bp_groups_filter_title() {
    5504         $current_filter = bp_action_variable( 0 );
    5505 
    5506         switch ( $current_filter ) {
    5507                 case 'recently-active': default:
    5508                         _e( 'Recently Active', 'buddypress' );
    5509                         break;
    5510                 case 'recently-joined':
    5511                         _e( 'Recently Joined', 'buddypress' );
    5512                         break;
    5513                 case 'most-popular':
    5514                         _e( 'Most Popular', 'buddypress' );
    5515                         break;
    5516                 case 'admin-of':
    5517                         _e( 'Administrator Of', 'buddypress' );
    5518                         break;
    5519                 case 'mod-of':
    5520                         _e( 'Moderator Of', 'buddypress' );
    5521                         break;
    5522                 case 'alphabetically':
    5523                         _e( 'Alphabetically', 'buddypress' );
    5524                 break;
    5525         }
    5526         do_action( 'bp_groups_filter_title' );
    5527 }
    5528 
    5529 /**
    55305391 * Echo the current group type message.
    55315392 *
  • trunk/src/bp-members/bp-members-adminbar.php

    r13443 r13493  
    1919 *
    2020 * @global WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API.
    21  *
    22  * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support.
    2321 */
    2422function bp_members_admin_bar_my_account_menu() {
  • trunk/src/bp-members/bp-members-functions.php

    r13468 r13493  
    265265
    266266/**
    267  * Return the ID of a user, based on user_login.
    268  *
    269  * No longer used.
    270  *
    271  * @todo Deprecate.
    272  *
    273  * @param string $user_login user_login of the user being queried.
    274  * @return int
    275  */
    276 function bp_core_get_displayed_userid( $user_login ) {
    277         return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid( $user_login ) );
    278 }
    279 
    280 /**
    281267 * Return the user ID based on a user's user_login.
    282268 *
     
    12481234
    12491235        return $wpdb->query( $sql );
    1250 }
    1251 
    1252 /**
    1253  * Fetch every post that is authored by the given user for the current blog.
    1254  *
    1255  * No longer used in BuddyPress.
    1256  *
    1257  * @todo Deprecate.
    1258  *
    1259  * @param int $user_id ID of the user being queried.
    1260  * @return array Post IDs.
    1261  */
    1262 function bp_core_get_all_posts_for_user( $user_id = 0 ) {
    1263         global $wpdb;
    1264 
    1265         if ( empty( $user_id ) ) {
    1266                 $user_id = bp_displayed_user_id();
    1267         }
    1268 
    1269         return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) );
    12701236}
    12711237
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r13461 r13493  
    621621 *
    622622 * @since 2.0.0
    623  * @todo Deprecate
     623 * @deprecated 12.0.0
    624624 *
    625625 * @param string $title Groups directory title.
     
    627627 */
    628628function bp_legacy_theme_group_create_button( $title ) {
     629        _deprecated_function( __FUNCTION__, '12.0.0' );
    629630        return $title . ' ' . bp_get_group_create_button();
    630631}
     
    663664 *
    664665 * @since 2.0.0
    665  * @todo Deprecate
     666 * @deprecated 12.0.0
    666667 *
    667668 * @param string $title Sites directory title.
     
    669670 */
    670671function bp_legacy_theme_blog_create_button( $title ) {
     672        _deprecated_function( __FUNCTION__, '12.0.0' );
    671673        return $title . ' ' . bp_get_blog_create_button();
    672674}
  • trunk/src/bp-templates/bp-nouveau/buddypress-functions.php

    r13481 r13493  
    654654         *
    655655         * @since 3.0.0
    656          * @todo deprecate The `bp_uri` filter is not available anymore. Is this function still needed using BP Rewrites?
     656         * @deprecated 12.0.0
    657657         *
    658658         * @param  string $path The BP Uri.
     
    660660         */
    661661        public function customizer_set_uri( $path ) {
     662                _deprecated_function( __METHOD__, '12.0.0' );
     663
    662664                if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
    663665                        return $path;
Note: See TracChangeset for help on using the changeset viewer.