Changeset 10434
- Timestamp:
- 01/03/2016 06:14:41 AM (9 years ago)
- Location:
- trunk/src/bp-xprofile
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-actions.php
r10417 r10434 85 85 do_action( 'bp_xprofile_settings_before_save' ); 86 86 87 /* *Save ******************************************************************/87 /* Save ******************************************************************/ 88 88 89 89 // Only save if there are field ID's being posted. … … 117 117 } 118 118 119 /* *Other *****************************************************************/119 /* Other *****************************************************************/ 120 120 121 121 /** -
trunk/src/bp-xprofile/bp-xprofile-activity.php
r10417 r10434 58 58 * @param string $action Static activity action. 59 59 * @param object $activity Activity object. 60 *61 60 * @return string 62 61 */ … … 88 87 * @param string $action Static activity action. 89 88 * @param object $activity Activity object. 90 *91 89 * @return string 92 90 */ … … 120 118 * 121 119 * @param array|string $args String containing all variables used after bp_parse_args() call. 122 *123 120 * @return array 124 121 */ … … 157 154 * 158 155 * @param array|string $args Containing all variables used after bp_parse_args() call. 159 *160 156 * @return bool 161 157 */ … … 183 179 * @param string $key Key. 184 180 * @param string $value Value. 185 *186 181 * @return bool True if success, false on failure. 187 182 */ … … 215 210 * 216 211 * @param int $user_id The user id the avatar was set for. 217 *218 212 * @return bool 219 213 */ … … 257 251 * @param array $old_values Pre-save xprofile field values and visibility levels. 258 252 * @param array $new_values Post-save xprofile field values and visibility levels. 259 *260 253 * @return bool True on success, false on failure. 261 254 */ -
trunk/src/bp-xprofile/bp-xprofile-admin.php
r10418 r10434 480 480 /** 481 481 * Handles the ajax reordering of fields within a group. 482 * 483 * @since 1.0.0 482 484 */ 483 485 function xprofile_ajax_reorder_fields() { … … 502 504 /** 503 505 * Handles the reordering of field groups. 506 * 507 * @since 1.5.0 504 508 */ 505 509 function xprofile_ajax_reorder_field_groups() { … … 522 526 /** 523 527 * Handles the WYSIWYG display of each profile field on the edit screen. 528 * 529 * @since 1.5.0 524 530 * 525 531 * @param object $admin_field Admin field. -
trunk/src/bp-xprofile/bp-xprofile-cache.php
r10417 r10434 21 21 * @param int $user_id User ID to check. 22 22 * @param array $field_ids XProfile field IDs. 23 *24 23 * @return array 25 24 */ … … 54 53 * @param array $object_ids Multi-dimensional array of object_ids, keyed by 55 54 * object type ('group', 'field', 'data'). 56 *57 55 * @return bool 58 56 */ … … 290 288 * @since 2.4.0 291 289 * 292 * @param int|BP_XProfile_Field A field ID or a field object.293 * @ parambool False on failure.290 * @param int|BP_XProfile_Field $field A field ID or a field object. 291 * @return bool False on failure. 294 292 */ 295 293 function bp_xprofile_clear_field_cache( $field ) { -
trunk/src/bp-xprofile/bp-xprofile-caps.php
r10163 r10434 24 24 * @uses get_post_type_object() To get the post type object. 25 25 * @uses apply_filters() Calls 'bp_map_meta_caps' with caps, cap, user id and args. 26 *27 26 * @return array Actual capabilities for meta capability. 28 27 */ -
trunk/src/bp-xprofile/bp-xprofile-filters.php
r10418 r10434 268 268 * @param mixed $field_value Field value. 269 269 * @param int $field_id Field type. 270 *271 270 * @return string 272 271 */ … … 284 283 * @param BP_XProfile_Field $field Field object. 285 284 * @param BP_XProfile_Field_Type $field_type_obj Field type object. 286 *287 285 * @return mixed 288 286 */ … … 310 308 function bp_xprofile_escape_field_data( $value, $field_type, $field_id ) { 311 309 if ( bp_xprofile_is_richtext_enabled_for_field( $field_id ) ) { 312 // xprofile_filter_kses() expects a BP_XProfile_ProfileData object.310 // The xprofile_filter_kses() expects a BP_XProfile_ProfileData object. 313 311 $data_obj = null; 314 312 if ( bp_is_user() ) { … … 337 335 * @param string $field_value Profile field data value. 338 336 * @param string $field_type Profile field type. 339 *340 337 * @return string 341 338 */ … … 484 481 * 485 482 * @param string $q SQL query. 486 *487 483 * @return string 488 484 */ -
trunk/src/bp-xprofile/bp-xprofile-functions.php
r10418 r10434 27 27 * @param array $args See {@link BP_XProfile_Group::get()} for description of 28 28 * arguments. 29 *30 29 * @return array $groups 31 30 */ … … 51 50 * 52 51 * @param array|string $args Array of arguments for field group insertion. 53 *54 52 * @return boolean 55 53 */ … … 84 82 * 85 83 * @param int $field_group_id Field group ID to fetch. 86 *87 84 * @return boolean|BP_XProfile_Group 88 85 */ … … 107 104 * 108 105 * @param int $field_group_id Field group ID to delete. 109 *110 106 * @return boolean 111 107 */ … … 131 127 * @param int $field_group_id Field group ID to update. 132 128 * @param int $position Field group position to update to. 133 *134 129 * @return boolean 135 130 */ … … 178 173 * 179 174 * @param string $type Type of profile field to create. See {@link bp_xprofile_get_field_types()} for default core values. 180 *181 175 * @return object $value If field type unknown, returns BP_XProfile_Field_Type_Textarea. 182 176 * Otherwise returns an instance of the relevant child class of BP_XProfile_Field_Type. … … 300 294 } 301 295 296 /** 297 * Delete a profile field object. 298 * 299 * @param int|object $field_id ID of the field or object representing field data. 300 * @return bool Whether or not the field was deleted. 301 */ 302 302 function xprofile_delete_field( $field_id ) { 303 303 $field = new BP_XProfile_Field( $field_id ); … … 320 320 * @param string $multi_format How should array data be returned? 'comma' if you want a 321 321 * comma-separated string; 'array' if you want an array. 322 *323 322 * @return mixed The profile field data. 324 323 */ … … 371 370 return $data; 372 371 } 372 373 373 /** 374 374 * A simple function to set profile data for a specific field for a specific user. … … 380 380 * @param mixed $value The value for the field you want to set for the user. 381 381 * @param bool $is_required Whether or not the field is required. 382 *383 382 * @return bool True on success, false on failure. 384 383 */ … … 459 458 * @param int $user_id The ID of the user to whom the data belongs. 460 459 * @param string $visibility_level What the visibity setting should be. 461 *462 460 * @return bool True on success 463 461 */ … … 492 490 * @param int $field_id The ID of the xprofile field. 493 491 * @param int $user_id The ID of the user to whom the data belongs. 494 *495 492 * @return string 496 493 */ … … 520 517 } 521 518 519 /** 520 * Delete XProfile field data. 521 * 522 * @param string $field Field to delete. 523 * @param int $user_id User ID to delete field from. 524 * @return bool Whether or not the field was deleted. 525 */ 522 526 function xprofile_delete_field_data( $field = '', $user_id = 0 ) { 523 527 … … 541 545 } 542 546 547 /** 548 * Check if field is a required field. 549 * 550 * @param int $field_id ID of the field to check for. 551 * @return bool Whether or not field is required. 552 */ 543 553 function xprofile_check_is_required_field( $field_id ) { 544 554 $field = new BP_XProfile_Field( $field_id ); … … 574 584 * @param bool $exclude_fullname Optional; whether or not to exclude the full name field as random data. 575 585 * Defaults to true. 576 *577 586 * @return string|bool The fetched random data for the user, or false if no data or no match. 578 587 */ … … 605 614 * @param string $field_type The type of field: datebox, selectbox, textbox etc. 606 615 * @param string $field_value The actual value. 607 *608 616 * @return string|bool The formatted value, or false if value is empty. 609 617 */ … … 624 632 } 625 633 634 /** 635 * Update the field position for a provided field. 636 * 637 * @param int $field_id ID of the field to update. 638 * @param int $position Position to update the field to. 639 * @param int $field_group_id Group ID for group the field is in. 640 * @return bool 641 */ 626 642 function xprofile_update_field_position( $field_id, $position, $field_group_id ) { 627 643 return BP_XProfile_Field::update_position( $field_id, $position, $field_group_id ); … … 666 682 * @param string $directory The root directory name. Optional. 667 683 * @param int $user_id The user ID. Optional. 668 *669 684 * @return array Array containing the path, URL, and other helpful settings. 670 685 */ … … 711 726 * @param array $sql Clauses in the user_id SQL query. 712 727 * @param BP_User_Query $query User query object. 713 *714 728 * @return array 715 729 */ … … 756 770 * 757 771 * @param int $user_id ID of the user to sync. 758 *759 772 * @return bool 760 773 */ … … 796 809 add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' ); 797 810 add_action( 'bp_core_activated_user', 'xprofile_sync_wp_profile' ); 798 799 811 800 812 /** … … 848 860 * delete matching metadata entries for the specified object. 849 861 * Default: false. 850 *851 862 * @return bool True on success, false on failure. 852 863 */ … … 898 909 * specified meta_key. This parameter has no effect if meta_key is not 899 910 * specified. Default: true. 900 *901 911 * @return mixed Meta value if found. False on failure. 902 912 */ … … 926 936 * metadata entries with the specified value. 927 937 * Otherwise update all entries. 928 *929 938 * @return bool|int Returns false on failure. On successful update of existing 930 939 * metadata, returns true. On successful creation of new metadata, … … 954 963 * has a value for the key, no change will be made. 955 964 * Default false. 956 *957 965 * @return int|bool The meta ID on successful update, false on failure. 958 966 */ … … 967 975 } 968 976 977 /** 978 * Updates the fieldgroup metadata. 979 * 980 * @param int $field_group_id Group ID for the group field belongs to. 981 * @param string $meta_key Meta key to update. 982 * @param string $meta_value Meta value to update to. 983 * @return bool|int 984 */ 969 985 function bp_xprofile_update_fieldgroup_meta( $field_group_id, $meta_key, $meta_value ) { 970 986 return bp_xprofile_update_meta( $field_group_id, 'group', $meta_key, $meta_value ); 971 987 } 972 988 989 /** 990 * Updates the field metadata. 991 * 992 * @param int $field_id Field ID to update. 993 * @param string $meta_key Meta key to update. 994 * @param string $meta_value Meta value to update to. 995 * @return bool|int 996 */ 973 997 function bp_xprofile_update_field_meta( $field_id, $meta_key, $meta_value ) { 974 998 return bp_xprofile_update_meta( $field_id, 'field', $meta_key, $meta_value ); 975 999 } 976 1000 1001 /** 1002 * Updates the fielddata metadata. 1003 * 1004 * @param int $field_data_id Field ID to update. 1005 * @param string $meta_key Meta key to update. 1006 * @param string $meta_value Meta value to update to. 1007 * @return bool|int 1008 */ 977 1009 function bp_xprofile_update_fielddata_meta( $field_data_id, $meta_key, $meta_value ) { 978 1010 return bp_xprofile_update_meta( $field_data_id, 'data', $meta_key, $meta_value ); … … 1004 1036 * Return the field name for the Full Name xprofile field. 1005 1037 * 1006 * @package BuddyPress1007 1038 * @since 1.5.0 1008 1039 * … … 1016 1047 * @since 1.5.0 1017 1048 * 1018 * @param string BP_XPROFILE_FULLNAME_FIELD_NAME Full name field constant.1049 * @param string $value BP_XPROFILE_FULLNAME_FIELD_NAME Full name field constant. 1019 1050 */ 1020 1051 return apply_filters( 'bp_xprofile_fullname_field_name', BP_XPROFILE_FULLNAME_FIELD_NAME ); … … 1086 1117 * @param int $displayed_user_id The id of the user the profile fields belong to. 1087 1118 * @param int $current_user_id The id of the user viewing the profile. 1088 *1089 1119 * @return array An array of field ids that should be excluded from the profile query 1090 1120 */ … … 1132 1162 * @param int $displayed_user_id The id of the user the profile fields belong to. 1133 1163 * @param int $current_user_id The id of the user viewing the profile. 1134 *1135 1164 * @return array An array of visibility levels hidden to the current user. 1136 1165 */ … … 1180 1209 * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', 'adminsonly' etc) to be 1181 1210 * checked against. 1182 *1183 1211 * @return array $field_ids The fields that match the requested visibility levels for the given user. 1184 1212 */ -
trunk/src/bp-xprofile/bp-xprofile-loader.php
r10417 r10434 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 /** 17 * Creates our XProfile component. 18 */ 16 19 class BP_XProfile_Component extends BP_Component { 17 20 … … 54 57 * Include files. 55 58 * 56 * @param array $includes 59 * @param array $includes Array of files to include. 57 60 */ 58 61 public function includes( $includes = array() ) { … … 237 240 } 238 241 239 // Change Cover image 242 // Change Cover image. 240 243 if ( bp_displayed_user_use_cover_image_header() ) { 241 244 $sub_nav[] = array( … … 410 413 * 411 414 * @param array $wp_admin_nav The settings adminbar nav array. 412 *413 415 * @return array 414 416 */ … … 430 432 } 431 433 434 /** 435 * Bootstrap the XProfile component. 436 */ 432 437 function bp_setup_xprofile() { 433 438 $bp = buddypress(); -
trunk/src/bp-xprofile/bp-xprofile-notifications.php
r10417 r10434 22 22 * @param string $format 'string' for BuddyBar-compatible notifications; 'array' 23 23 * for WP Toolbar. Default: 'string'. 24 *25 24 * @return string 26 25 */ … … 33 32 * Notifications must have a 'component_name' of 'xprofile' to be routed 34 33 * to this function. 35 *36 34 * 37 35 * @since 2.4.0 -
trunk/src/bp-xprofile/bp-xprofile-screens.php
r10417 r10434 303 303 function xprofile_screen_change_cover_image() { 304 304 305 // Bail if not the correct screen 305 // Bail if not the correct screen. 306 306 if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { 307 307 return false; -
trunk/src/bp-xprofile/bp-xprofile-settings.php
r10417 r10434 17 17 * 18 18 * @param array|string $args Array of args for the settings fields. 19 *20 19 * @return array 21 20 */ -
trunk/src/bp-xprofile/bp-xprofile-template.php
r10417 r10434 165 165 } 166 166 167 /** 168 * Whether or not the loop has field groups. 169 * 170 * @return bool 171 */ 167 172 public function has_groups() { 168 173 if ( ! empty( $this->group_count ) ) { … … 173 178 } 174 179 180 /** 181 * Increments to the next group of fields. 182 * 183 * @return object 184 */ 175 185 public function next_group() { 176 186 $this->current_group++; … … 196 206 } 197 207 208 /** 209 * Rewinds to the start of the groups list. 210 */ 198 211 public function rewind_groups() { 199 212 $this->current_group = -1; … … 203 216 } 204 217 218 /** 219 * Kicks off the profile groups. 220 * 221 * @return bool 222 */ 205 223 public function profile_groups() { 206 224 if ( $this->current_group + 1 < $this->group_count ) { … … 223 241 } 224 242 243 /** 244 * Sets up the profile group. 245 */ 225 246 public function the_profile_group() { 226 247 global $group; … … 243 264 /** Fields ****************************************************************/ 244 265 266 /** 267 * Increments to the next field. 268 * 269 * @return int 270 */ 245 271 public function next_field() { 246 272 $this->current_field++; … … 251 277 } 252 278 279 /** 280 * Rewinds to the start of the fields. 281 */ 253 282 public function rewind_fields() { 254 283 $this->current_field = -1; … … 258 287 } 259 288 289 /** 290 * Whether or not the loop has fields. 291 * 292 * @return bool 293 */ 260 294 public function has_fields() { 261 295 $has_data = false; … … 272 306 } 273 307 308 /** 309 * Kick off the profile fields. 310 * 311 * @return bool 312 */ 274 313 public function profile_fields() { 275 314 if ( $this->current_field + 1 < $this->field_count ) { … … 283 322 } 284 323 324 /** 325 * Set up the profile fields. 326 */ 285 327 public function the_profile_field() { 286 328 global $field; … … 369 411 } 370 412 413 /** 414 * Start off the profile groups. 415 * 416 * @return mixed 417 */ 371 418 function bp_profile_groups() { 372 419 global $profile_template; … … 374 421 } 375 422 423 /** 424 * Set up the profile groups. 425 * 426 * @return mixed 427 */ 376 428 function bp_the_profile_group() { 377 429 global $profile_template; … … 379 431 } 380 432 433 /** 434 * Whether or not the group has fields to display. 435 * 436 * @return mixed 437 */ 381 438 function bp_profile_group_has_fields() { 382 439 global $profile_template; … … 384 441 } 385 442 443 /** 444 * Output the class attribute for a field. 445 * 446 * @param string|bool $class Extra classes to append to class attribute. 447 */ 386 448 function bp_field_css_class( $class = false ) { 387 449 echo bp_get_field_css_class( $class ); 388 450 } 451 452 /** 453 * Return the class attribute for a field. 454 * 455 * @param string|bool $class Extra classes to append to class attribute. 456 * @return string 457 */ 389 458 function bp_get_field_css_class( $class = false ) { 390 459 global $profile_template; … … 437 506 } 438 507 508 /** 509 * Whether or not the XProfile field has data to display. 510 * 511 * @return mixed 512 */ 439 513 function bp_field_has_data() { 440 514 global $profile_template; … … 442 516 } 443 517 518 /** 519 * Whether or not the XProfile field has public data to display. 520 * 521 * @return bool 522 */ 444 523 function bp_field_has_public_data() { 445 524 global $profile_template; … … 452 531 } 453 532 533 /** 534 * Output the XProfile group ID. 535 */ 454 536 function bp_the_profile_group_id() { 455 537 echo bp_get_the_profile_group_id(); 456 538 } 539 540 /** 541 * Return the XProfile group ID. 542 * 543 * @return mixed|void 544 */ 457 545 function bp_get_the_profile_group_id() { 458 546 global $group; 459 547 460 548 /** 461 * Filters the profile group ID.549 * Filters the XProfile group ID. 462 550 * 463 551 * @since 1.1.0 … … 468 556 } 469 557 558 /** 559 * Output the XProfile group name. 560 */ 470 561 function bp_the_profile_group_name() { 471 562 echo bp_get_the_profile_group_name(); 472 563 } 564 565 /** 566 * Return the XProfile group name. 567 * 568 * @return mixed|void 569 */ 473 570 function bp_get_the_profile_group_name() { 474 571 global $group; 475 572 476 573 /** 477 * Filters the profile group name.574 * Filters the XProfile group name. 478 575 * 479 576 * @since 1.0.0 … … 484 581 } 485 582 583 /** 584 * Output the XProfile group slug. 585 */ 486 586 function bp_the_profile_group_slug() { 487 587 echo bp_get_the_profile_group_slug(); 488 588 } 589 590 /** 591 * Return the XProfile group slug. 592 * 593 * @return mixed|void 594 */ 489 595 function bp_get_the_profile_group_slug() { 490 596 global $group; 491 597 492 598 /** 493 * Filters the profile group slug.599 * Filters the XProfile group slug. 494 600 * 495 601 * @since 1.1.0 … … 500 606 } 501 607 608 /** 609 * Output the XProfile group description. 610 */ 502 611 function bp_the_profile_group_description() { 503 612 echo bp_get_the_profile_group_description(); 504 613 } 614 615 /** 616 * Return the XProfile group description. 617 * 618 * @return mixed|void 619 */ 505 620 function bp_get_the_profile_group_description() { 506 621 global $group; 507 622 508 623 /** 509 * Filters the profile group description.624 * Filters the XProfile group description. 510 625 * 511 626 * @since 1.0.0 … … 516 631 } 517 632 633 /** 634 * Output the XProfile group edit form action. 635 */ 518 636 function bp_the_profile_group_edit_form_action() { 519 637 echo bp_get_the_profile_group_edit_form_action(); 520 638 } 639 640 /** 641 * Return the XProfile group edit form action. 642 * 643 * @return mixed|void 644 */ 521 645 function bp_get_the_profile_group_edit_form_action() { 522 646 global $group; … … 526 650 527 651 /** 528 * Filters the action for the profile group edit form.652 * Filters the action for the XProfile group edit form. 529 653 * 530 654 * @since 1.1.0 … … 536 660 } 537 661 662 /** 663 * Output the XProfile group field IDs. 664 */ 538 665 function bp_the_profile_group_field_ids() { 539 666 echo bp_get_the_profile_group_field_ids(); 540 667 } 668 669 /** 670 * Return the XProfile group field IDs. 671 * 672 * @return string 673 */ 541 674 function bp_get_the_profile_group_field_ids() { 542 675 global $group; … … 590 723 } 591 724 725 /** 726 * Return the XProfile fields. 727 * 728 * @return mixed 729 */ 592 730 function bp_profile_fields() { 593 731 global $profile_template; … … 595 733 } 596 734 735 /** 736 * Sets up the XProfile field. 737 * 738 * @return mixed 739 */ 597 740 function bp_the_profile_field() { 598 741 global $profile_template; … … 600 743 } 601 744 745 /** 746 * Output the XProfile field ID. 747 */ 602 748 function bp_the_profile_field_id() { 603 749 echo bp_get_the_profile_field_id(); 604 750 } 751 752 /** 753 * Return the XProfile field ID. 754 * @return mixed|void 755 */ 605 756 function bp_get_the_profile_field_id() { 606 757 global $field; 607 758 608 759 /** 609 * Filters the profile field ID.760 * Filters the XProfile field ID. 610 761 * 611 762 * @since 1.1.0 … … 616 767 } 617 768 769 /** 770 * Outputs the XProfile field name. 771 */ 618 772 function bp_the_profile_field_name() { 619 773 echo bp_get_the_profile_field_name(); 620 774 } 775 776 /** 777 * Returns the XProfile field name. 778 * 779 * @return mixed|void 780 */ 621 781 function bp_get_the_profile_field_name() { 622 782 global $field; 623 783 624 784 /** 625 * Filters the profile field name.785 * Filters the XProfile field name. 626 786 * 627 787 * @since 1.0.0 … … 632 792 } 633 793 794 /** 795 * Outputs the XProfile field value. 796 */ 634 797 function bp_the_profile_field_value() { 635 798 echo bp_get_the_profile_field_value(); 636 799 } 800 801 /** 802 * Returns the XProfile field value. 803 * 804 * @return mixed|void 805 */ 637 806 function bp_get_the_profile_field_value() { 638 807 global $field; … … 641 810 642 811 /** 643 * Filters the profile field value.812 * Filters the XProfile field value. 644 813 * 645 814 * @since 1.0.0 … … 652 821 } 653 822 823 /** 824 * Outputs the XProfile field edit value. 825 */ 654 826 function bp_the_profile_field_edit_value() { 655 827 echo bp_get_the_profile_field_edit_value(); 656 828 } 829 830 /** 831 * Returns the XProfile field edit value. 832 * 833 * @return mixed|void 834 */ 657 835 function bp_get_the_profile_field_edit_value() { 658 836 global $field; … … 681 859 682 860 /** 683 * Filters the profile field edit value.861 * Filters the XProfile field edit value. 684 862 * 685 863 * @since 1.1.0 … … 692 870 } 693 871 872 /** 873 * Outputs the XProfile field type. 874 */ 694 875 function bp_the_profile_field_type() { 695 876 echo bp_get_the_profile_field_type(); 696 877 } 878 879 /** 880 * Returns the XProfile field type. 881 * 882 * @return mixed|void 883 */ 697 884 function bp_get_the_profile_field_type() { 698 885 global $field; 699 886 700 887 /** 701 * Filters the profile field type.888 * Filters the XProfile field type. 702 889 * 703 890 * @since 1.1.0 … … 708 895 } 709 896 897 /** 898 * Outputs the XProfile field description. 899 */ 710 900 function bp_the_profile_field_description() { 711 901 echo bp_get_the_profile_field_description(); 712 902 } 903 904 /** 905 * Returns the XProfile field description. 906 * 907 * @return mixed|void 908 */ 713 909 function bp_get_the_profile_field_description() { 714 910 global $field; 715 911 716 912 /** 717 * Filters the profile field description.913 * Filters the XProfile field description. 718 914 * 719 915 * @since 1.1.0 … … 724 920 } 725 921 922 /** 923 * Outputs the XProfile field input name. 924 */ 726 925 function bp_the_profile_field_input_name() { 727 926 echo bp_get_the_profile_field_input_name(); 728 927 } 928 929 /** 930 * Retursn the XProfile field input name. 931 * 932 * @return mixed|void 933 */ 729 934 function bp_get_the_profile_field_input_name() { 730 935 global $field; … … 821 1026 } 822 1027 1028 /** 1029 * Render whether or not a profile field is required. 1030 */ 823 1031 function bp_the_profile_field_is_required() { 824 1032 echo bp_get_the_profile_field_is_required(); 825 1033 } 1034 1035 /** 1036 * Return whether or not a profile field is required. 1037 * @return mixed|void 1038 */ 826 1039 function bp_get_the_profile_field_is_required() { 827 1040 global $field; … … 844 1057 845 1058 /** 846 * Echothe visibility level of this field.1059 * Output the visibility level of this field. 847 1060 */ 848 1061 function bp_the_profile_field_visibility_level() { 849 1062 echo bp_get_the_profile_field_visibility_level(); 850 1063 } 1064 851 1065 /** 852 1066 * Return the visibility level of this field. 1067 * 1068 * @return mixed|void 853 1069 */ 854 1070 function bp_get_the_profile_field_visibility_level() { … … 880 1096 echo bp_get_the_profile_field_visibility_level_label(); 881 1097 } 1098 882 1099 /** 883 1100 * Return the visibility level label of this field. 1101 * 1102 * @return mixed|void 884 1103 */ 885 1104 function bp_get_the_profile_field_visibility_level_label() { … … 907 1126 } 908 1127 909 1128 /** 1129 * Return unserialized profile field data. 1130 * 1131 * @param string $value Content to maybe unserialize. 1132 * @return mixed|string 1133 */ 910 1134 function bp_unserialize_profile_field( $value ) { 911 1135 if ( is_serialized($value) ) { … … 918 1142 } 919 1143 1144 /** 1145 * Output XProfile field data. 1146 * 1147 * @param string|array $args Array of arguments for field data. 1148 */ 920 1149 function bp_profile_field_data( $args = '' ) { 921 1150 echo bp_get_profile_field_data( $args ); 922 1151 } 1152 1153 /** 1154 * Return XProfile field data. 1155 * 1156 * @param string|array $args Array of arguments for field data. 1157 * @return mixed|void 1158 */ 923 1159 function bp_get_profile_field_data( $args = '' ) { 924 1160 … … 1054 1290 } 1055 1291 1292 /** 1293 * Output the XProfile group name. 1294 * 1295 * @param bool $deprecated Deprecated boolean parameter. 1296 * @return mixed|void 1297 */ 1056 1298 function bp_profile_group_name( $deprecated = true ) { 1057 1299 if ( !$deprecated ) { … … 1061 1303 } 1062 1304 } 1305 1306 /** 1307 * Return the XProfile group name. 1308 * 1309 * @return mixed|void 1310 */ 1063 1311 function bp_get_profile_group_name() { 1064 1312 … … 1082 1330 } 1083 1331 1332 /** 1333 * Render a formatted string displaying when a profile was last updated. 1334 */ 1084 1335 function bp_profile_last_updated() { 1085 1336 … … 1092 1343 } 1093 1344 } 1345 1346 /** 1347 * Return a formatted string displaying when a profile was last updated. 1348 * 1349 * @return bool|mixed|void 1350 */ 1094 1351 function bp_get_profile_last_updated() { 1095 1352 … … 1111 1368 } 1112 1369 1370 /** 1371 * Display the current profile group ID. 1372 */ 1113 1373 function bp_current_profile_group_id() { 1114 1374 echo bp_get_current_profile_group_id(); 1115 1375 } 1376 1377 /** 1378 * Return the current profile group ID. 1379 * 1380 * @since 1.1.0 1381 * 1382 * @return mixed|void 1383 */ 1116 1384 function bp_get_current_profile_group_id() { 1117 1385 $profile_group_id = bp_action_variable( 1 ); … … 1132 1400 } 1133 1401 1402 /** 1403 * Render an avatar delete link. 1404 */ 1134 1405 function bp_avatar_delete_link() { 1135 1406 echo bp_get_avatar_delete_link(); 1136 1407 } 1408 1409 /** 1410 * Return an avatar delete link. 1411 * 1412 * @since 1.1.0 1413 * @return mixed|void 1414 */ 1137 1415 function bp_get_avatar_delete_link() { 1138 1416 … … 1147 1425 } 1148 1426 1427 /** 1428 * Render an edit profile button. 1429 */ 1149 1430 function bp_edit_profile_button() { 1150 1431 bp_button( array( … … 1174 1455 * 1175 1456 * @param array|string $args Args for the radio buttons. 1176 *1177 1457 * @return string $retval 1178 1458 */ … … 1253 1533 * 1254 1534 * @param array|string $args Args for the select list. 1255 *1256 1535 * @return string $retval 1257 1536 */ … … 1320 1599 * 1321 1600 * @since 2.4.0 1322 *1323 * @return string HTML for the required label.1324 1601 */ 1325 1602 function bp_the_profile_field_required_label() { -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
r10418 r10434 311 311 * date string (Y-m-d H:i:s). 312 312 * @param string|int $field_id Optional. ID of the field. 313 *314 313 * @return string Date formatted by bp_format_time(). 315 314 */ -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-url.php
r10418 r10434 47 47 * Must be used inside the {@link bp_profile_fields()} template loop. 48 48 * 49 * @since 2.1.0 50 * 49 51 * @param array $raw_properties Optional key/value array of 50 52 * {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes} 51 53 * that you want to add. 52 *53 * @since 2.1.054 54 */ 55 55 public function edit_field_html( array $raw_properties = array() ) { … … 87 87 * Must be used inside the {@link bp_profile_fields()} template loop. 88 88 * 89 * @since 2.1.0 90 * 89 91 * @param array $raw_properties Optional key/value array of permitted 90 92 * attributes that you want to add. 91 * @since 2.1.092 93 */ 93 94 public function admin_field_html( array $raw_properties = array() ) { … … 131 132 * @param string $submitted_value Raw value submitted by the user. 132 133 * @param string|int $field_id Optional. ID of the field. 133 *134 134 * @return string 135 135 */ … … 161 161 * @param string $field_value The URL value, as saved in the database. 162 162 * @param string|int $field_id Optional. ID of the field. 163 *164 163 * @return string URL converted to a link. 165 164 */ -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type.php
r10418 r10434 20 20 /** 21 21 * Validation regex rules for field type. 22 * 22 23 * @since 2.0.0 23 24 * @var array Field type validation regexes. -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php
r10418 r10434 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 /** 14 * Class to help set up XProfile fields. 15 */ 13 16 class BP_XProfile_Field { 14 17 … … 17 20 * 18 21 * @since 1.0.0 19 *20 22 * @var int ID of field. 21 23 */ … … 26 28 * 27 29 * @since 1.0.0 28 *29 30 * @var int Field group ID for field. 30 31 */ … … 35 36 * 36 37 * @since 1.0.0 37 *38 38 * @var int Parent ID of field. 39 39 */ … … 44 44 * 45 45 * @since 1.0.0 46 *47 46 * @var string Field type. 48 47 */ … … 53 52 * 54 53 * @since 1.0.0 55 *56 54 * @var string Field name. 57 55 */ … … 62 60 * 63 61 * @since 1.0.0 64 *65 62 * @var string Field description. 66 63 */ … … 71 68 * 72 69 * @since 1.0.0 73 *74 70 * @var bool Is field required to be filled out? 75 71 */ … … 80 76 * 81 77 * @since 1.0.0 82 *83 78 * @var int Can field be deleted? 84 79 */ … … 89 84 * 90 85 * @since 1.0.0 91 *92 86 * @var int Field position. 93 87 */ … … 98 92 * 99 93 * @since 1.0.0 100 *101 94 * @var int Option order. 102 95 */ … … 107 100 * 108 101 * @since 1.0.0 109 *110 102 * @var string Order child fields by. 111 103 */ … … 116 108 * 117 109 * @since 1.0.0 118 *119 110 * @var bool Is this the default option for this field? 120 111 */ … … 126 117 * @since 1.9.0 127 118 * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_default_visibility()`. 128 *129 119 * @var string Default field data visibility. 130 120 */ … … 136 126 * @since 2.3.0 137 127 * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_allow_custom_visibility()`. 138 *139 128 * @var string Members are allowed/disallowed to modify data visibility. 140 129 */ … … 145 134 * 146 135 * @since 2.0.0 147 *148 136 * @var BP_XProfile_Field_Type Field type object used for validation. 149 137 */ … … 154 142 * 155 143 * @since 2.0.0 156 *157 144 * @var BP_XProfile_ProfileData Field data for user ID. 158 145 */ … … 323 310 * 324 311 * @param boolean $delete_data Whether or not to delete data. 325 *326 312 * @return boolean 327 313 */ … … 486 472 do_action_ref_array( 'xprofile_field_after_save', array( $this ) ); 487 473 488 // Recreate type_obj in case someone changed $this->type via a filter 474 // Recreate type_obj in case someone changed $this->type via a filter. 489 475 $this->type_obj = bp_xprofile_create_field_type( $this->type ); 490 476 $this->type_obj->field_obj = $this; … … 502 488 * 503 489 * @param int $user_id ID of the user to get field data for. 504 *505 490 * @return object 506 491 */ … … 517 502 * 518 503 * @param bool $for_editing Whether or not the field is for editing. 519 *520 504 * @return array 521 505 */ … … 639 623 * @param bool $append Whether to append to existing member types. If false, all existing member type 640 624 * associations will be deleted before adding your `$member_types`. Default false. 641 *642 625 * @return array Member types for the current field, after being saved. 643 626 */ … … 810 793 } 811 794 812 /** Static Methods ********************************************************/ 813 795 /* Static Methods ********************************************************/ 796 797 /** 798 * Get the type for provided field ID. 799 * 800 * @param int $field_id Field ID to get type of. 801 * @return bool|null|string 802 */ 814 803 public static function get_type( $field_id = 0 ) { 815 804 global $wpdb; … … 840 829 * 841 830 * @param int $group_id ID of the field group to delete fields from. 842 *843 831 * @return boolean 844 832 */ … … 871 859 * 872 860 * @param string $field_name Name of the field to query the ID for. 873 *874 861 * @return boolean 875 862 */ … … 898 885 * @param int|null $position Field position to update. 899 886 * @param int|null $field_group_id ID of the field group. 900 *901 887 * @return boolean 902 888 */ … … 934 920 * @param string|array $member_types Member type or array of member types. Use 'any' to return unrestricted 935 921 * fields (those available for anyone, regardless of member type). 936 *937 922 * @return array Multi-dimensional array, with field IDs as top-level keys, and arrays of member types 938 923 * associated with each field as values. … … 1075 1060 1076 1061 /** 1077 * This function populates the items for radio buttons checkboxes and drop 1078 * down boxes. 1062 * Populates the items for radio buttons, checkboxes, and dropdown boxes. 1079 1063 */ 1080 1064 public function render_admin_form_children() { … … 1489 1473 * 1490 1474 * @param int $field_id ID of field to check. 1491 *1492 1475 * @return bool 1493 1476 */ -
trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php
r10417 r10434 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 /** 14 * Class to help set up XProfile Groups. 15 */ 13 16 class BP_XProfile_Group { 14 17 … … 17 20 * 18 21 * @since 1.1.0 19 *20 22 * @var int ID of field group 21 23 */ … … 26 28 * 27 29 * @since 1.1.0 28 *29 30 * @var string Name of field group 30 31 */ … … 35 36 * 36 37 * @since 1.1.0 37 *38 38 * @var string Description of field group 39 39 */ … … 44 44 * 45 45 * @since 1.1.0 46 *47 46 * @var bool Can this group be deleted? 48 47 */ … … 53 52 * 54 53 * @since 1.1.0 55 *56 54 * @var int Group order relative to other groups 57 55 */ … … 62 60 * 63 61 * @since 1.1.0 64 *65 62 * @var array Fields of group 66 63 */ … … 180 177 * @since 1.1.0 181 178 * 182 * @global object $wpdb 179 * @global object $wpdb 180 * 183 181 * @return boolean 184 182 */ … … 235 233 * Populates the BP_XProfile_Group object with profile field groups, fields, 236 234 * and field data 237 *238 * @package BuddyPress XProfile239 235 * 240 236 * @global object $wpdb WordPress DB access object. … … 501 497 * 502 498 * @param array $group_ids Array of IDs. 503 *504 499 * @return array 505 500 */ … … 592 587 * 593 588 * @global $wpdb $wpdb 589 * 594 590 * @param int $field_group_id ID of the group the field belongs to. 595 591 * @param int $position Field group position. 596 *597 592 * @return boolean 598 593 */ … … 619 614 * @param int $user_id The profile owner's user_id. 620 615 * @param array $fields The database results returned by the get() query. 621 *622 616 * @return array $fields The database results, with field_visibility added 623 617 */ -
trunk/src/bp-xprofile/classes/class-bp-xprofile-profiledata.php
r10417 r10434 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 /** 14 * Class for XProfile Profile Data setup. 15 * 16 * @since 1.6.0 17 */ 13 18 class BP_XProfile_ProfileData { 19 20 /** 21 * XProfile ID. 22 * 23 * @var int $id 24 */ 14 25 public $id; 26 27 /** 28 * User ID. 29 * 30 * @var int $user_id 31 */ 15 32 public $user_id; 33 34 /** 35 * XProfile field ID. 36 * 37 * @var int $field_id 38 */ 16 39 public $field_id; 40 41 /** 42 * XProfile field value. 43 * 44 * @var string $value 45 */ 17 46 public $value; 47 48 /** 49 * XProfile field last updated time. 50 * 51 * @var string $last_updated 52 */ 18 53 public $last_updated; 19 54 55 /** 56 * BP_XProfile_ProfileData constructor. 57 * 58 * @param null $field_id Field ID to instantiate. 59 * @param null $user_id User ID to instantiate for. 60 */ 20 61 public function __construct( $field_id = null, $user_id = null ) { 21 62 if ( !empty( $field_id ) ) { … … 24 65 } 25 66 67 /** 68 * Populates the XProfile profile data. 69 * 70 * @param int $field_id Field ID to populate. 71 * @param int $user_id User ID to populate for. 72 */ 26 73 public function populate( $field_id, $user_id ) { 27 74 global $wpdb; … … 111 158 } 112 159 160 /** 161 * Save the data for the XProfile field. 162 * 163 * @return bool 164 */ 113 165 public function save() { 114 166 global $wpdb; … … 208 260 * @param int $user_id ID of user whose data is being queried. 209 261 * @param array $field_ids Array of field IDs to query for. 210 *211 262 * @return array 212 263 */ … … 274 325 * 275 326 * @param int $user_id ID of the user. 276 *277 327 * @return array 278 328 */ … … 321 371 * @param int $field_id Field ID being queried for. 322 372 * @param int $user_id User ID associated with field. 323 *324 373 * @return int $fielddata_id 325 374 */ … … 352 401 * @param int $field_id ID of the field. 353 402 * @param int|array|null $user_ids ID or IDs of user(s). 354 *355 403 * @return string|array Single value if a single user is queried, 356 404 * otherwise an array of results. … … 428 476 } 429 477 478 /** 479 * Get profile field values by field name and user ID. 480 * 481 * @param array|string $fields Field(s) to get. 482 * @param int|null $user_id User ID to get field data for. 483 * @return array|bool 484 */ 430 485 public static function get_value_byfieldname( $fields, $user_id = null ) { 431 486 global $wpdb; … … 483 538 } 484 539 540 /** 541 * Delete field. 542 * 543 * @param int $field_id ID of the field to delete. 544 * @return bool 545 */ 485 546 public static function delete_for_field( $field_id ) { 486 547 global $wpdb; … … 495 556 } 496 557 558 /** 559 * Get time for last XProfile field data update by user. 560 * 561 * @param int $user_id User ID to get time for. 562 * @return null|string 563 */ 497 564 public static function get_last_updated( $user_id ) { 498 565 global $wpdb; … … 505 572 } 506 573 574 /** 575 * Delete all data for provided user ID. 576 * 577 * @param int $user_id User ID to remove data for. 578 * @return false|int 579 */ 507 580 public static function delete_data_for_user( $user_id ) { 508 581 global $wpdb; … … 513 586 } 514 587 588 /** 589 * Get random field type by user ID. 590 * 591 * @param int $user_id User ID to query for. 592 * @param string $exclude_fullname SQL portion used to exclude by field ID. 593 * @return array|null|object 594 */ 515 595 public static function get_random( $user_id, $exclude_fullname ) { 516 596 global $wpdb; … … 523 603 } 524 604 605 /** 606 * Get fullname for provided user ID. 607 * 608 * @param int $user_id ID of the user to query. 609 * @return mixed 610 */ 525 611 public static function get_fullname( $user_id = 0 ) { 526 612 -
trunk/src/bp-xprofile/classes/class-bp-xprofile-query.php
r10417 r10434 24 24 * 25 25 * @since 2.2.0 26 * @var 26 * @var array 27 27 */ 28 28 public $queries = array(); … … 32 32 * 33 33 * @since 2.2.0 34 * @var 34 * @var string 35 35 */ 36 36 public $primary_table; … … 40 40 * 41 41 * @since 2.2.0 42 * @var 42 * @var string 43 43 */ 44 44 public $primary_id_column; … … 48 48 * 49 49 * @since 2.2.0 50 * @var 50 * @var array 51 51 */ 52 52 protected $table_aliases = array(); … … 93 93 * 94 94 * @param array $queries Array of query clauses. 95 *96 95 * @return array Sanitized array of query clauses. 97 96 */ … … 160 159 * 161 160 * @param array $query XProfile query arguments. 162 *163 161 * @return bool Whether the query clause is a first-order clause. 164 162 */ … … 173 171 * 174 172 * @param string $type MySQL type to cast `value`. 175 *176 173 * @return string MySQL type. 177 174 */ … … 231 228 * @since 2.2.0 232 229 * 233 * @param array $query Query to parse. 230 * @param array $query Query to parse. Passed by reference. 234 231 * @param int $depth Optional. Number of tree levels deep we currently are. Used to calculate indentation. 235 *236 232 * @return array { 237 233 * Array containing JOIN and WHERE SQL clauses to append to a single query array. … … 314 310 * @param string $primary_table Database table where the object being filtered is stored (eg wp_users). 315 311 * @param string $primary_id_column ID column for the filtered object in $primary_table. 316 *317 312 * @return array { 318 313 * Array containing JOIN and WHERE SQL clauses to append to the main query. … … 349 344 * @param array $clause Query clause. 350 345 * @param array $parent_query Parent query array. 351 *352 346 * @return array { 353 347 * Array containing JOIN and WHERE SQL clauses to append to a first-order query. … … 499 493 * @param array $clause Query clause. 500 494 * @param array $parent_query Parent query of $clause. 501 *502 495 * @return string|bool Table alias if found, otherwise false. 503 496 */
Note: See TracChangeset
for help on using the changeset viewer.