base; // The prefix of the $screen_id is translated, use only the suffix // to identify a screen: $ids = array( 'groups-admin' => __( 'Groups', GROUPS_PLUGIN_DOMAIN ), 'groups-admin-groups' => __( 'Groups', GROUPS_PLUGIN_DOMAIN ), 'groups-admin-options' => __( 'Options', GROUPS_PLUGIN_DOMAIN ), 'groups-admin-capabilities' => __( 'Capabilities', GROUPS_PLUGIN_DOMAIN ), ); 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 .= __( 'The complete documentation is available on the Documentation pages for Groups.', GROUPS_PLUGIN_DOMAIN ); $help .= '

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

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

'; 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 $footer_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 */ public static function footer( $render = true ) { $footer = '' . __( 'Thank you for using Groups by itthinx.', GROUPS_PLUGIN_DOMAIN ) . ' ' . sprintf( __( 'Please give it a ★★★★★ rating.', GROUPS_PLUGIN_DOMAIN ), esc_attr( 'http://wordpress.org/support/view/plugin-reviews/groups?filter=5#postform' ) ) . ''; $footer = apply_filters( 'groups_footer', $footer ); if ( $render ) { echo $footer; } else { return $footer; } } } Groups_Help::init();