Changeset 13868
- Timestamp:
- 05/19/2024 11:00:37 AM (4 months ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13818 r13868 703 703 function bp_core_add_contextual_help( $screen = '' ) { 704 704 705 $screen = get_current_screen(); 706 $bp_forum = sprintf( 707 '<a href="%1$s">%2$s</a>', 708 esc_url( 'https://buddypress.org/support/' ), 709 esc_html__( 'Support Forums', 'buddypress' ) 710 ); 705 $screen = get_current_screen(); 706 $documentation_link = ''; 711 707 712 708 switch ( $screen->id ) { … … 724 720 ); 725 721 726 $ manage_components= sprintf(722 $documentation_link = sprintf( 727 723 '<a href="%1$s">%2$s</a>', 728 724 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/settings/components.md' ), 729 725 esc_html__( 'Managing Components', 'buddypress' ) 730 );731 732 // Help panel - sidebar links.733 $screen->set_help_sidebar(734 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .735 '<p>' . $manage_components . '</p>' .736 '<p>' . $bp_forum . '</p>'737 726 ); 738 727 break; … … 750 739 ); 751 740 752 $ manage_rewrites= sprintf(741 $documentation_link = sprintf( 753 742 '<a href="%1$s">%2$s</a>', 754 743 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/settings/urls.md' ), 755 744 esc_html__( 'Managing URLs', 'buddypress' ) 756 );757 758 // Help panel - sidebar links.759 $screen->set_help_sidebar(760 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .761 '<p>' . $manage_rewrites . '</p>' .762 '<p>' . $bp_forum . '</p>'763 745 ); 764 746 break; … … 776 758 ); 777 759 778 $ manage_settings= sprintf(760 $documentation_link = sprintf( 779 761 '<a href="%1$s">%2$s</a>', 780 762 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/settings/options.md' ), 781 763 esc_html__( 'Managing Settings', 'buddypress' ) 782 764 ); 783 784 // Help panel - sidebar links.785 $screen->set_help_sidebar(786 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .787 '<p>' . $manage_settings . '</p>' .788 '<p>' . $bp_forum . '</p>'789 );790 791 765 break; 792 766 … … 803 777 ); 804 778 805 $ manage_profile_fields= sprintf(779 $documentation_link = sprintf( 806 780 '<a href="%1$s">%2$s</a>', 807 781 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/users/xprofile.md' ), 808 782 esc_html__( 'Managing Profile Fields', 'buddypress' ) 809 783 ); 810 811 // Help panel - sidebar links.812 $screen->set_help_sidebar(813 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .814 '<p>' . $manage_profile_fields . '</p>' .815 '<p>' . $bp_forum . '</p>'816 );817 818 784 break; 819 785 … … 828 794 ); 829 795 830 $ manage_member_types= sprintf(796 $documentation_link = sprintf( 831 797 '<a href="%1$s">%2$s</a>', 832 798 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/users/member-types.md' ), 833 799 esc_html__( 'Managing Member Types', 'buddypress' ) 834 800 ); 835 836 // Help panel - sidebar links.837 $screen->set_help_sidebar(838 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .839 '<p>' . $manage_member_types . '</p>' .840 '<p>' . $bp_forum . '</p>'841 );842 843 801 break; 802 803 case 'edit-bp-email': 804 // Help tab. 805 $screen->add_help_tab( 806 array( 807 'id' => 'bp-emails-overview', 808 'title' => __( 'Overview', 'buddypress' ), 809 'content' => bp_core_add_contextual_help_content( 'bp-emails-overview' ), 810 ) 811 ); 812 813 $documentation_link = sprintf( 814 '<a href="%1$s">%2$s</a>', 815 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/emails/README.md' ), 816 esc_html__( 'Managing BP Emails', 'buddypress' ) 817 ); 818 break; 819 820 case 'bp-email': 821 // Help tab. 822 $screen->add_help_tab( 823 array( 824 'id' => 'bp-email-overview', 825 'title' => __( 'Overview', 'buddypress' ), 826 'content' => bp_core_add_contextual_help_content( 'bp-email-overview' ), 827 ) 828 ); 829 830 $documentation_link = sprintf( 831 '<a href="%1$s">%2$s</a>', 832 esc_url( 'https://github.com/buddypress/buddypress/blob/master/docs/user/administration/emails/tokens.md' ), 833 esc_html__( 'BP Email tokens usage', 'buddypress' ) 834 ); 835 break; 836 } 837 838 if ( $documentation_link ) { 839 $bp_forum = sprintf( 840 '<a href="%1$s">%2$s</a>', 841 esc_url( 'https://buddypress.org/support/' ), 842 esc_html__( 'Support Forums', 'buddypress' ) 843 ); 844 845 // Help panel - sidebar links. 846 $screen->set_help_sidebar( 847 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' . 848 '<p>' . $documentation_link . '</p>' . 849 '<p>' . $bp_forum . '</p>' 850 ); 844 851 } 845 852 } … … 883 890 case 'bp-member-types-overview': 884 891 $retval = __( 'Member Types in BuddyPress provide a powerful way to classify users within your community. By defining various member types, such as "Students", "Teachers", or "Alumni", you can create a more organized and tailored community environment. This feature is especially useful for communities with diverse user groups, allowing customized interactions, content access, and privileges.', 'buddypress' ); 892 break; 893 894 case 'bp-emails-overview': 895 $retval = __( 'This screen provides access to all BP Emails. Hovering over a row in the BP Emails list will display action links that allow you to manage the corresponding BP Email.', 'buddypress' ); 896 break; 897 898 case 'bp-email-overview': 899 $retval = sprintf( 900 /* Translators: %s contains braces within a code tag. */ 901 __( 'Phrases wrapped in braces %s are email tokens. Tokens are variable strings that will get replaced with dynamic content when the email gets sent.', 'buddypress' ), 902 '<code>{{ }}</code>' 903 ); 885 904 break; 886 905 … … 1256 1275 } 1257 1276 add_action( 'admin_head-edit.php', 'bp_admin_email_maybe_add_translation_notice' ); 1258 1259 /**1260 * In emails editor, add notice linking to token documentation on Codex.1261 *1262 * @since 2.5.01263 */1264 function bp_admin_email_add_codex_notice() {1265 if ( get_current_screen()->post_type !== bp_get_email_post_type() ) {1266 return;1267 }1268 1269 bp_core_add_admin_notice(1270 sprintf(1271 // Translators: %s is the url to the BuddyPress codex page about BP Email tokens.1272 __( 'Phrases wrapped in braces <code>{{ }}</code> are email tokens. <a href="%s">Learn about tokens on the BuddyPress Codex</a>.', 'buddypress' ),1273 esc_url( 'https://codex.buddypress.org/emails/email-tokens/' )1274 ),1275 'error'1276 );1277 }1278 add_action( 'admin_head-post.php', 'bp_admin_email_add_codex_notice' );1279 1277 1280 1278 /** -
trunk/src/bp-core/classes/class-bp-admin.php
r13840 r13868 227 227 // Emails 228 228 add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 ); 229 add_action( 'load-edit.php', array( $this, 'post_type_load_admin_screen' ), 20 ); 230 add_action( 'load-post.php', array( $this, 'post_type_load_admin_screen' ), 20 ); 229 231 230 232 // Official BuddyPress supported Add-ons. … … 1290 1292 } 1291 1293 1294 /** 1295 * Adds BP Custom Post Types Admin screen's help tab. 1296 * 1297 * @since 14.0.0 1298 */ 1299 public function post_type_load_admin_screen() { 1300 $screen = null; 1301 if ( function_exists( 'get_current_screen' ) ) { 1302 $screen = get_current_screen(); 1303 } 1304 1305 if ( ! isset( $screen->post_type ) || bp_get_email_post_type() !== $screen->post_type ) { 1306 return; 1307 } 1308 1309 bp_core_add_contextual_help( $screen ); 1310 } 1311 1292 1312 /** Helpers ***************************************************************/ 1293 1313 -
trunk/src/bp-core/deprecated/14.0.php
r13741 r13868 64 64 return apply_filters_deprecated( 'bp_use_wp_admin_bar', array( $use_admin_bar ), '14.0.0' ); 65 65 } 66 67 /** 68 * In emails editor, add notice linking to token documentation on Codex. 69 * 70 * @since 2.5.0 71 * @deprecated 14.0.0 72 */ 73 function bp_admin_email_add_codex_notice() { 74 _deprecated_function( __FUNCTION__, '14.0.0' ); 75 76 if ( get_current_screen()->post_type !== bp_get_email_post_type() ) { 77 return; 78 } 79 80 bp_core_add_admin_notice( 81 sprintf( 82 // Translators: %s is the url to the BuddyPress codex page about BP Email tokens. 83 __( 'Phrases wrapped in braces <code>{{ }}</code> are email tokens. <a href="%s">Learn about tokens on the BuddyPress Codex</a>.', 'buddypress' ), 84 esc_url( 'https://codex.buddypress.org/emails/email-tokens/' ) 85 ), 86 'error' 87 ); 88 }
Note: See TracChangeset
for help on using the changeset viewer.