base; // The prefix of the $screen_id is translated, use only the suffix // to identify a screen: $ids = array( 'groups-admin' => _x( 'Groups', 'Help tab title and heading', 'groups' ), 'groups-admin-groups' => _x( 'Groups', 'Help tab title and heading', 'groups' ), 'groups-admin-options' => _x( 'Options', 'Help tab title and heading', 'groups' ), 'groups-admin-capabilities' => _x( 'Capabilities', 'Help tab title and heading', 'groups' ), ); foreach ( $ids as $id => $title ) { $i = strpos( $screen_id, $id ); if ( $i !== false ) { if ( $i + strlen( $id ) == strlen( $screen_id ) ) { $screen_id = $id; $show_groups_help = true; $help_title = $title; break; } } } if ( $show_groups_help ) { $help = '

'. $help_title .'

'; $help .= '

'; $help .= sprintf( /* translators: documentation pages link */ __( 'The complete documentation is available on the %s pages for Groups.', 'groups' ), sprintf( '%s', __( 'Documentation', 'groups' ) ) ); $help .= '

'; switch ( $screen_id ) { case 'groups-admin' : case 'groups-admin-groups': $help .= '

' . __( 'Here you can add, edit and remove groups.', 'groups' ) . '

'; break; case 'groups-admin-options' : case 'groups-admin-capabilities' : break; } $screen->add_help_tab( array( 'id' => $screen_id, 'title' => $help_title, 'content' => $help ) ); } } } /** * Provides the footer text for Groups on relevant screens. * * @param string $text * * @return mixed */ public static function admin_footer_text( $text ) { if ( function_exists( 'get_current_screen' ) ) { $current_screen = get_current_screen(); if ( isset( $current_screen->id ) && ( stripos( $current_screen->id, 'groups-' ) === 0 || stripos( $current_screen->id, 'groups_' ) === 0 || stripos( $current_screen->id, 'toplevel_page_groups' ) === 0 ) ) { $text = self::footer( false ); } } return $text; } /** * Returns or renders the footer. * * @param boolean $render * * @return string|null */ public static function footer( $render = true ) { $footer = '' . sprintf( /* translators: 1: link 2: link */ __( 'Thank you for using %1$s by %2$s.', 'groups' ), 'Groups', 'itthinx' ) . ' ' . sprintf( /* translators: link */ __( 'Please give it a ★★★★★ rating.', 'groups' ), esc_attr( 'https://wordpress.org/support/view/plugin-reviews/groups?filter=5#postform' ) ) . ''; $footer = apply_filters( 'groups_footer', $footer ); if ( $render ) { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $footer; // @phpstan-ignore return.missing } else { return $footer; } } } Groups_Help::init();