Changeset 14026 for trunk/src/class-buddypress.php
- Timestamp:
- 09/27/2024 09:11:27 PM (15 months ago)
- File:
-
- 1 edited
-
trunk/src/class-buddypress.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/class-buddypress.php
r13953 r14026 657 657 require $this->plugin_dir . sprintf( 'bp-core/deprecated/%s.php', number_format( $deprecated_functions_version, 1 ) ); 658 658 } 659 }659 } 660 660 661 661 // Load wp-cli module if PHP 5.6+. … … 674 674 * @since 2.5.0 675 675 * 676 * @param string $class Classes to be autoloaded. 677 * @return string Path of a class. 678 */ 679 public function autoload( $class ) { 680 $class_parts = explode( '_', strtolower( $class ) ); 676 * @param string $class_name Classes to be autoloaded. 677 */ 678 public function autoload( $class_name ) { 679 $class_parts = explode( '_', strtolower( $class_name ) ); 681 680 682 681 if ( 'bp' !== $class_parts[0] ) { … … 699 698 // These classes don't have a name that matches their component. 700 699 $irregular_map = array( 701 'BP_Akismet' => 'activity', 702 'BP_REST_Activity_Endpoint' => 'activity', 703 704 'BP_REST_Blogs_Endpoint' => 'blogs', 705 'BP_REST_Attachments_Blog_Avatar_Endpoint' => 'blogs', 706 707 'BP_Admin' => 'core', 708 'BP_Attachment_Avatar' => 'core', 709 'BP_Attachment_Cover_Image' => 'core', 710 'BP_Attachment' => 'core', 711 'BP_Button' => 'core', 712 'BP_Block' => 'core', 713 'BP_Component' => 'core', 714 'BP_Customizer_Control_Range' => 'core', 715 'BP_Date_Query' => 'core', 716 'BP_Email_Delivery' => 'core', 717 'BP_Email_Address' => 'core', 718 'BP_Email_Recipient' => 'core', 719 'BP_Email_Sender' => 'core', 720 'BP_Email_Participant' => 'core', 721 'BP_Email' => 'core', 722 'BP_Embed' => 'core', 723 'BP_Media_Extractor' => 'core', 724 'BP_Members_Suggestions' => 'core', 725 'BP_PHPMailer' => 'core', 726 'BP_Recursive_Query' => 'core', 727 'BP_Suggestions' => 'core', 728 'BP_Theme_Compat' => 'core', 729 'BP_User_Query' => 'core', 730 'BP_Walker_Category_Checklist' => 'core', 731 'BP_Walker_Nav_Menu' => 'core', 732 'BP_Invitation_Manager' => 'core', 733 'BP_Invitation' => 'core', 734 'BP_REST_Components_Endpoint' => 'core', 735 'BP_REST_Attachments' => 'core', 736 'BP_Admin_Types' => 'core', 737 'BP_Optout' => 'core', 738 'BP_Optouts_List_Table' => 'core', 739 740 'BP_REST_Friends_Endpoint' => 'friends', 741 742 'BP_Group_Extension' => 'groups', 743 'BP_Group_Member_Query' => 'groups', 744 'BP_REST_Groups_Endpoint' => 'groups', 745 'BP_REST_Group_Membership_Endpoint' => 'groups', 746 'BP_REST_Group_Invites_Endpoint' => 'groups', 747 'BP_REST_Group_Membership_Request_Endpoint' => 'groups', 748 'BP_REST_Attachments_Group_Avatar_Endpoint' => 'groups', 749 'BP_REST_Attachments_Group_Cover_Endpoint' => 'groups', 750 751 'BP_Core_Members_Template' => 'members', 752 'BP_Registration_Theme_Compat' => 'members', 753 'BP_Signup' => 'members', 754 'BP_REST_Members_Endpoint' => 'members', 755 'BP_REST_Attachments_Member_Avatar_Endpoint' => 'members', 756 'BP_REST_Attachments_Member_Cover_Endpoint' => 'members', 757 'BP_REST_Signup_Endpoint' => 'members', 758 'BP_Members_Invitation_Manager' => 'members', 759 'BP_Members_Invitations_Template' => 'members', 760 'BP_Members_Invitations_Component' => 'members', 761 762 'BP_REST_Messages_Endpoint' => 'messages', 763 'BP_REST_Sitewide_Notices_Endpoint' => 'messages', 764 765 'BP_REST_Notifications_Endpoint' => 'notifications', 766 767 'BP_REST_XProfile_Fields_Endpoint' => 'xprofile', 768 'BP_REST_XProfile_Field_Groups_Endpoint' => 'xprofile', 769 'BP_REST_XProfile_Data_Endpoint' => 'xprofile', 700 'BP_Akismet' => 'activity', 701 'BP_Admin' => 'core', 702 'BP_Attachment_Avatar' => 'core', 703 'BP_Attachment_Cover_Image' => 'core', 704 'BP_Attachment' => 'core', 705 'BP_Button' => 'core', 706 'BP_Block' => 'core', 707 'BP_Component' => 'core', 708 'BP_Customizer_Control_Range' => 'core', 709 'BP_Date_Query' => 'core', 710 'BP_Email_Delivery' => 'core', 711 'BP_Email_Address' => 'core', 712 'BP_Email_Recipient' => 'core', 713 'BP_Email_Sender' => 'core', 714 'BP_Email_Participant' => 'core', 715 'BP_Email' => 'core', 716 'BP_Embed' => 'core', 717 'BP_Media_Extractor' => 'core', 718 'BP_Members_Suggestions' => 'core', 719 'BP_PHPMailer' => 'core', 720 'BP_Recursive_Query' => 'core', 721 'BP_Suggestions' => 'core', 722 'BP_Theme_Compat' => 'core', 723 'BP_User_Query' => 'core', 724 'BP_Walker_Category_Checklist' => 'core', 725 'BP_Walker_Nav_Menu' => 'core', 726 'BP_Invitation_Manager' => 'core', 727 'BP_Invitation' => 'core', 728 'BP_REST_Attachments' => 'core', 729 'BP_Admin_Types' => 'core', 730 'BP_Optout' => 'core', 731 'BP_Optouts_List_Table' => 'core', 732 'BP_Group_Extension' => 'groups', 733 'BP_Group_Member_Query' => 'groups', 734 'BP_Core_Members_Template' => 'members', 735 'BP_Registration_Theme_Compat' => 'members', 736 'BP_Signup' => 'members', 737 'BP_Members_Invitation_Manager' => 'members', 738 'BP_Members_Invitations_Template' => 'members', 739 'BP_Members_Invitations_Component' => 'members', 770 740 ); 771 741 … … 773 743 774 744 // First check to see if the class is one without a properly namespaced name. 775 if ( isset( $irregular_map[ $class ] ) ) {776 $component = $irregular_map[ $class ];777 778 // Next chunk is usually the component name.745 if ( isset( $irregular_map[ $class_name ] ) ) { 746 $component = $irregular_map[ $class_name ]; 747 748 // Next chunk is usually the component name. 779 749 } elseif ( in_array( $class_parts[1], $components, true ) ) { 780 750 $component = $class_parts[1]; … … 786 756 787 757 // Sanitize class name. 788 $class = strtolower( str_replace( '_', '-', $class ) );758 $class = strtolower( str_replace( '_', '-', $class_name ) ); 789 759 790 760 if ( 'bp-rest-attachments' === $class ) { 791 $path = dirname( __FILE__ ). "/bp-{$component}/classes/trait-attachments.php";761 $path = __DIR__ . "/bp-{$component}/classes/trait-attachments.php"; 792 762 } else { 793 $path = dirname( __FILE__ ). "/bp-{$component}/classes/class-{$class}.php";763 $path = __DIR__ . "/bp-{$component}/classes/class-{$class}.php"; 794 764 } 795 765 … … 878 848 $this->db_version_raw = (int) $versions['1.6-single']; 879 849 880 // If no 1.6-single exists, use the max of the others.850 // If no 1.6-single exists, use the max of the others. 881 851 } else { 882 852 $versions['1.2'] = get_site_option( 'bp-core-db-version' );
Note: See TracChangeset
for help on using the changeset viewer.