id ) { // Set the main plugin page to be the active submenu page $submenu_file = HMBKP_PLUGIN_SLUG; } return $submenu_file; } add_filter( 'submenu_file', 'HM\BackUpWordPress\highlight_submenu' ); /** * Add a link to the backups page to the plugin action links. * * @param array $links * @param string $file * * @return array $links */ function plugin_action_link( $links, $file ) { if ( false !== strpos( $file, HMBKP_PLUGIN_SLUG ) ) { array_push( $links, '' . __( 'Backups', 'backupwordpress' ) . '' ); } return $links; } add_filter( 'plugin_action_links', 'HM\BackUpWordPress\plugin_action_link', 10, 2 ); /** * Add Contextual Help to Backups tools page. * * Help is pulled from the readme FAQ. * * @return null */ function contextual_help() { // Pre WordPress 3.3 compat if ( ! method_exists( get_current_screen(), 'add_help_tab' ) ) { return; } ob_start(); require_once( HMBKP_PLUGIN_PATH . 'admin/constants.php' ); $constants = ob_get_clean(); ob_start(); include_once( HMBKP_PLUGIN_PATH . 'admin/faq.php' ); $faq = ob_get_clean(); get_current_screen()->add_help_tab( array( 'title' => __( 'FAQ', 'backupwordpress' ), 'id' => 'hmbkp_faq', 'content' => wp_kses_post( $faq ), ) ); get_current_screen()->add_help_tab( array( 'title' => __( 'Constants', 'backupwordpress' ), 'id' => 'hmbkp_constants', 'content' => wp_kses_post( $constants ), ) ); require_once( HMBKP_PLUGIN_PATH . 'classes/class-requirements.php' ); ob_start(); require_once( HMBKP_PLUGIN_PATH . 'admin/server-info.php' ); $info = ob_get_clean(); get_current_screen()->add_help_tab( array( 'title' => __( 'Server Info', 'backupwordpress' ), 'id' => 'hmbkp_server', 'content' => $info, ) ); get_current_screen()->set_help_sidebar( '
' . esc_html__( 'For more information:', 'backupwordpress' ) . '
' . esc_html__( 'Support Forums', 'backupwordpress' ) . '
' . esc_html__( 'Help with translation', 'backupwordpress' ) . '
' ); } add_action( 'load-' . HMBKP_ADMIN_PAGE, 'HM\BackUpWordPress\contextual_help' );