Changeset 12776
- Timestamp:
- 11/09/2020 02:47:32 AM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r12745 r12776 2978 2978 function bp_get_taxonomy_common_labels() { 2979 2979 return array( 2980 'bp_type_name' => _x( ' Name', 'BP Type name label', 'buddypress' ),2980 'bp_type_name' => _x( 'Plural Name', 'BP Type name label', 'buddypress' ), 2981 2981 'bp_type_singular_name' => _x( 'Singular name', 'BP Type singular name label', 'buddypress' ), 2982 'bp_type_has_directory' => _x( ' Add Type-FilteredDirectory View', 'BP Type has directory checkbox label', 'buddypress' ),2982 'bp_type_has_directory' => _x( 'Has Directory View', 'BP Type has directory checkbox label', 'buddypress' ), 2983 2983 'bp_type_directory_slug' => _x( 'Custom type directory slug', 'BP Type slug label', 'buddypress' ), 2984 2984 ); … … 3087 3087 function bp_get_type_metadata_schema( $suppress_filters = false, $type_taxonomy = '' ) { 3088 3088 $schema = array( 3089 'bp_type_ name' => array(3090 'description' => __( 'The name of your type, at the plural form.', 'buddypress' ),3089 'bp_type_singular_name' => array( 3090 'description' => __( 'The name of this type in singular form. ', 'buddypress' ), 3091 3091 'type' => 'string', 3092 3092 'single' => true, 3093 3093 'sanitize_callback' => 'sanitize_text_field', 3094 3094 ), 3095 'bp_type_ singular_name' => array(3096 'description' => __( 'The name of your type, at the singularform.', 'buddypress' ),3095 'bp_type_name' => array( 3096 'description' => __( 'The name of this type in plural form.', 'buddypress' ), 3097 3097 'type' => 'string', 3098 3098 'single' => true, … … 3100 3100 ), 3101 3101 'bp_type_has_directory' => array( 3102 'description' => __( ' Add a list of members matching the member type available on the Members Directory page (e.g. site.url/members/type/teacher/).', 'buddypress' ),3102 'description' => __( 'Make a list matching this type available on the directory.', 'buddypress' ), 3103 3103 'type' => 'boolean', 3104 3104 'single' => true, … … 3106 3106 ), 3107 3107 'bp_type_directory_slug' => array( 3108 'label' => __( ' Custom type directoryslug', 'buddypress' ),3109 'description' => __( ' If you want to use a slug that is different from the Member Type ID above, enter it here.', 'buddypress' ),3108 'label' => __( 'Type slug', 'buddypress' ), 3109 'description' => __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' ), 3110 3110 'type' => 'string', 3111 3111 'single' => true, -
trunk/src/bp-groups/bp-groups-functions.php
r12764 r12776 2510 2510 'bp_get_group_type_tax_labels', 2511 2511 array( 2512 'name' => _x( 'Group types', 'Group type taxonomy name', 'buddypress' ), 2513 'singular_name' => _x( 'Group type', 'Group type taxonomy singular name', 'buddypress' ), 2514 'search_items' => _x( 'Search Group types', 'Group type taxonomy search items label', 'buddypress' ), 2515 'popular_items' => _x( 'Most used Group types', 'Group type taxonomy popular items label', 'buddypress' ), 2516 'all_items' => _x( 'All Group types', 'Group type taxonomy all items label', 'buddypress' ), 2517 'edit_item' => _x( 'Edit Group type', 'Group type taxonomy edit item label', 'buddypress' ), 2518 'view_item' => _x( 'View Group type', 'Group type taxonomy view item label', 'buddypress' ), 2519 'update_item' => _x( 'Update Group type', 'Group type taxonomy update item label', 'buddypress' ), 2520 'add_new_item' => _x( 'Add new Group type', 'Group type taxonomy add new item label', 'buddypress' ), 2521 'new_item_name' => _x( 'New Group type name', 'Group type taxonomy new item name label', 'buddypress' ), 2522 'separate_items_with_commas' => _x( 'Separate Group types with commas', 'Group type taxonomy separate items with commas label', 'buddypress' ), 2523 'add_or_remove_items' => _x( 'Add or remove Group types', 'Group type taxonomy add or remove items label', 'buddypress' ), 2524 'choose_from_most_used' => _x( 'Choose from the most used Group types', 'Group type taxonomy choose from most used label', 'buddypress' ), 2525 'not_found' => _x( 'No Group types found', 'Group type taxonomy not found label', 'buddypress' ), 2526 'no_terms' => _x( 'No Group types', 'Group type taxonomy no terms label', 'buddypress' ), 2527 'items_list_navigation' => _x( 'Group types list navigation', 'Group type taxonomy items list navigation label', 'buddypress' ), 2528 'items_list' => _x( 'Group types list', 'Group type taxonomy items list label', 'buddypress' ), 2529 'back_to_items' => _x( 'Back to all Group types', 'Group type taxonomy back to items label', 'buddypress' ), 2512 2513 // General labels 2514 'name' => _x( 'Group Types', 'Group type taxonomy name', 'buddypress' ), 2515 'singular_name' => _x( 'Group Type', 'Group type taxonomy singular name', 'buddypress' ), 2516 'search_items' => _x( 'Search Group Types', 'Group type taxonomy search items label', 'buddypress' ), 2517 'popular_items' => _x( 'Popular Group Types', 'Group type taxonomy popular items label', 'buddypress' ), 2518 'all_items' => _x( 'All Group Types', 'Group type taxonomy all items label', 'buddypress' ), 2519 'parent_item' => _x( 'Parent Group Type', 'Group type taxonomy parent item label', 'buddypress' ), 2520 'parent_item_colon' => _x( 'Parent Group Type:', 'Group type taxonomy parent item label', 'buddypress' ), 2521 'edit_item' => _x( 'Edit Group Type', 'Group type taxonomy edit item label', 'buddypress' ), 2522 'view_item' => _x( 'View Group Type', 'Group type taxonomy view item label', 'buddypress' ), 2523 'update_item' => _x( 'Update Group Type', 'Group type taxonomy update item label', 'buddypress' ), 2524 'add_new_item' => _x( 'Add New Group Type', 'Group type taxonomy add new item label', 'buddypress' ), 2525 'new_item_name' => _x( 'New Group Type Name', 'Group type taxonomy new item name label', 'buddypress' ), 2526 'separate_items_with_commas' => _x( 'Separate group types with commas', 'Group type taxonomy separate items with commas label', 'buddypress' ), 2527 'add_or_remove_items' => _x( 'Add or remove group types', 'Group type taxonomy add or remove items label', 'buddypress' ), 2528 'choose_from_most_used' => _x( 'Choose from the most used group types', 'Group type taxonomy choose from most used label', 'buddypress' ), 2529 'not_found' => _x( 'No group types found.', 'Group type taxonomy not found label', 'buddypress' ), 2530 'no_terms' => _x( 'No group types', 'Group type taxonomy no terms label', 'buddypress' ), 2531 'items_list_navigation' => _x( 'Group Types list navigation', 'Group type taxonomy items list navigation label', 'buddypress' ), 2532 'items_list' => _x( 'Group Types list', 'Group type taxonomy items list label', 'buddypress' ), 2533 2534 /* translators: Tab heading when selecting from the most used terms. */ 2535 'most_used' => _x( 'Most Used', 'Group type taxonomy most used items label', 'buddypress' ), 2536 'back_to_items' => _x( '← Back to Group Types', 'Group type taxonomy back to items label', 'buddypress' ), 2537 2530 2538 // Specific to BuddyPress. 2531 2539 'bp_type_id_label' => _x( 'Group Type ID', 'BP Member type ID label', 'buddypress' ), 2532 'bp_type_id_description' => _x( ' Enter a lower-case string without spaces or special characters (used internally to identify the group type).', 'BP Group type ID description', 'buddypress' ),2533 'bp_type_show_in_create_screen' => _x( ' Add to Available Types on Create Screen', 'BP Group type show in create screen', 'buddypress' ),2534 'bp_type_show_in_list' => _x( ' Include when Group Types are Listed for aGroup', 'BP Group type show in list', 'buddypress' ),2540 'bp_type_id_description' => _x( 'Lower-case string, no spaces or special characters. Used to identify the group type.', 'BP Group type ID description', 'buddypress' ), 2541 'bp_type_show_in_create_screen' => _x( 'Show on Group Creation', 'BP Group type show in create screen', 'buddypress' ), 2542 'bp_type_show_in_list' => _x( 'Show on Group', 'BP Group type show in list', 'buddypress' ), 2535 2543 ) 2536 2544 ); … … 2557 2565 array_merge( 2558 2566 array( 2559 'description' => _x( 'BuddyPress Group types', 'Group type taxonomy description', 'buddypress' ),2567 'description' => _x( 'BuddyPress Group Types', 'Group type taxonomy description', 'buddypress' ), 2560 2568 'labels' => array_merge( bp_get_group_type_tax_labels(), bp_get_taxonomy_common_labels() ), 2561 2569 ), … … 2614 2622 function bp_get_group_type_metadata_schema( $schema = array(), $taxonomy = '' ) { 2615 2623 if ( bp_get_group_type_tax_name() === $taxonomy ) { 2624 2625 // Directory 2616 2626 if ( isset( $schema['bp_type_has_directory']['description'] ) ) { 2617 $schema['bp_type_has_directory']['description'] = __( ' Add a list of groups matching the group type available on the Groups Directory page (e.g. site.url/groups/type/ninja/).', 'buddypress' );2627 $schema['bp_type_has_directory']['description'] = __( 'Make a list of groups matching this type available on the groups directory.', 'buddypress' ); 2618 2628 } 2619 2629 2630 // Slug 2620 2631 if ( isset( $schema['bp_type_directory_slug']['description'] ) ) { 2621 $schema['bp_type_directory_slug']['description'] = __( ' If you want to use a slug that is different from the Group Type ID above, enter it here.', 'buddypress' );2632 $schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' ); 2622 2633 } 2623 2634 2624 $schema = array_merge( 2625 $schema, 2626 array( 2627 'bp_type_show_in_create_screen' => array( 2628 'description' => __( 'Include this group type during group creation and when a group administrator is on the group’s “Manage > Settings” page.', 'buddypress' ), 2629 'type' => 'boolean', 2630 'single' => true, 2631 'sanitize_callback' => 'absint', 2632 ), 2633 'bp_type_show_in_list' => array( 2634 'description' => __( 'Include this group type when group types are listed, like in the group header.', 'buddypress' ), 2635 'type' => 'boolean', 2636 'single' => true, 2637 'sanitize_callback' => 'absint', 2638 ), 2639 ) 2635 // Create 2636 $schema['bp_type_show_in_create_screen'] = array( 2637 'description' => __( 'Show during group creation, and when a group admin is on the group’s settings page.', 'buddypress' ), 2638 'type' => 'boolean', 2639 'single' => true, 2640 'sanitize_callback' => 'absint', 2641 ); 2642 2643 // List 2644 $schema['bp_type_show_in_list'] = array( 2645 'description' => __( 'Show where group types may be listed, like in the group header.', 'buddypress' ), 2646 'type' => 'boolean', 2647 'single' => true, 2648 'sanitize_callback' => 'absint', 2640 2649 ); 2641 2650 } -
trunk/src/bp-members/bp-members-functions.php
r12768 r12776 2690 2690 'bp_get_member_type_tax_labels', 2691 2691 array( 2692 'name' => _x( 'Member types', 'Member type taxonomy name', 'buddypress' ), 2693 'singular_name' => _x( 'Member type', 'Member type taxonomy singular name', 'buddypress' ), 2694 'search_items' => _x( 'Search Member types', 'Member type taxonomy search items label', 'buddypress' ), 2695 'popular_items' => _x( 'Most used Member types', 'Member type taxonomy popular items label', 'buddypress' ), 2696 'all_items' => _x( 'All Member types', 'Member type taxonomy all items label', 'buddypress' ), 2697 'edit_item' => _x( 'Edit Member type', 'Member type taxonomy edit item label', 'buddypress' ), 2698 'view_item' => _x( 'View Member type', 'Member type taxonomy view item label', 'buddypress' ), 2699 'update_item' => _x( 'Update Member type', 'Member type taxonomy update item label', 'buddypress' ), 2700 'add_new_item' => _x( 'Add new Member type', 'Member type taxonomy add new item label', 'buddypress' ), 2701 'new_item_name' => _x( 'New Member type name', 'Member type taxonomy new item name label', 'buddypress' ), 2702 'separate_items_with_commas' => _x( 'Separate Member types with commas', 'Member type taxonomy separate items with commas label', 'buddypress' ), 2703 'add_or_remove_items' => _x( 'Add or remove Member types', 'Member type taxonomy add or remove items label', 'buddypress' ), 2704 'choose_from_most_used' => _x( 'Choose from the most used Member types', 'Member type taxonomy choose from most used label', 'buddypress' ), 2705 'not_found' => _x( 'No Member types found', 'Member type taxonomy not found label', 'buddypress' ), 2706 'no_terms' => _x( 'No Member types', 'Member type taxonomy no terms label', 'buddypress' ), 2707 'items_list_navigation' => _x( 'Member types list navigation', 'Member type taxonomy items list navigation label', 'buddypress' ), 2708 'items_list' => _x( 'Member types list', 'Member type taxonomy items list label', 'buddypress' ), 2709 'back_to_items' => _x( 'Back to all Member types', 'Member type taxonomy back to items label', 'buddypress' ), 2692 2693 // General labels 2694 'name' => _x( 'Member Types', 'Member type taxonomy name', 'buddypress' ), 2695 'singular_name' => _x( 'Member Type', 'Member type taxonomy singular name', 'buddypress' ), 2696 'search_items' => _x( 'Search Member Types', 'Member type taxonomy search items label', 'buddypress' ), 2697 'popular_items' => _x( 'Popular Member Types', 'Member type taxonomy popular items label', 'buddypress' ), 2698 'all_items' => _x( 'All Member Types', 'Member type taxonomy all items label', 'buddypress' ), 2699 'parent_item' => _x( 'Parent Member Type', 'Member type taxonomy parent item label', 'buddypress' ), 2700 'parent_item_colon' => _x( 'Parent Member Type:', 'Member type taxonomy parent item label', 'buddypress' ), 2701 'edit_item' => _x( 'Edit Member Type', 'Member type taxonomy edit item label', 'buddypress' ), 2702 'view_item' => _x( 'View Member Type', 'Member type taxonomy view item label', 'buddypress' ), 2703 'update_item' => _x( 'Update Member Type', 'Member type taxonomy update item label', 'buddypress' ), 2704 'add_new_item' => _x( 'Add New Member Type', 'Member type taxonomy add new item label', 'buddypress' ), 2705 'new_item_name' => _x( 'New Member Type Name', 'Member type taxonomy new item name label', 'buddypress' ), 2706 'separate_items_with_commas' => _x( 'Separate member types with commas', 'Member type taxonomy separate items with commas label', 'buddypress' ), 2707 'add_or_remove_items' => _x( 'Add or remove member types', 'Member type taxonomy add or remove items label', 'buddypress' ), 2708 'choose_from_most_used' => _x( 'Choose from the most used meber types', 'Member type taxonomy choose from most used label', 'buddypress' ), 2709 'not_found' => _x( 'No member types found.', 'Member type taxonomy not found label', 'buddypress' ), 2710 'no_terms' => _x( 'No member types', 'Member type taxonomy no terms label', 'buddypress' ), 2711 'items_list_navigation' => _x( 'Member Types list navigation', 'Member type taxonomy items list navigation label', 'buddypress' ), 2712 'items_list' => _x( 'Member Types list', 'Member type taxonomy items list label', 'buddypress' ), 2713 2714 /* translators: Tab heading when selecting from the most used terms. */ 2715 'most_used' => _x( 'Most Used', 'Member type taxonomy most used items label', 'buddypress' ), 2716 'back_to_items' => _x( '← Back to Member Types', 'Member type taxonomy back to items label', 'buddypress' ), 2717 2710 2718 // Specific to BuddyPress. 2711 2719 'bp_type_id_label' => _x( 'Member Type ID', 'BP Member type ID label', 'buddypress' ), … … 2735 2743 array_merge( 2736 2744 array( 2737 'description' => _x( 'BuddyPress Member types', 'Member type taxonomy description', 'buddypress' ),2745 'description' => _x( 'BuddyPress Member Types', 'Member type taxonomy description', 'buddypress' ), 2738 2746 'labels' => array_merge( bp_get_member_type_tax_labels(), bp_get_taxonomy_common_labels() ), 2739 2747 ), … … 2742 2750 ); 2743 2751 } 2752 2753 /** 2754 * Extend generic Type metadata schema to match Member Type needs. 2755 * 2756 * @since 7.0.0 2757 * 2758 * @param array $schema The generic Type metadata schema. 2759 * @param string $taxonomy The taxonomy name the schema applies to. 2760 * @return array The Member Type metadata schema. 2761 */ 2762 function bp_get_member_type_metadata_schema( $schema = array(), $taxonomy = '' ) { 2763 if ( bp_get_member_type_tax_name() === $taxonomy ) { 2764 2765 // Directory 2766 if ( isset( $schema['bp_type_has_directory']['description'] ) ) { 2767 $schema['bp_type_has_directory']['description'] = __( 'Make a list of members matching this type available on the members directory.', 'buddypress' ); 2768 } 2769 2770 // Slug 2771 if ( isset( $schema['bp_type_directory_slug']['description'] ) ) { 2772 $schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' ); 2773 } 2774 } 2775 2776 return $schema; 2777 } 2778 add_filter( 'bp_get_type_metadata_schema', 'bp_get_member_type_metadata_schema', 1, 2 ); 2744 2779 2745 2780 /**
Note: See TracChangeset
for help on using the changeset viewer.