Skip to content

Commit

Permalink
initial pass at adding a help tab to screen
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Mar 9, 2020
1 parent 97e3d99 commit 40c7038
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/WPBT/WPBT_Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function load_requires() {
require_once $this->dir . '/src/WPBT/WPBT_Core.php';
require_once $this->dir . '/src/WPBT/WPBT_Extras.php';
require_once $this->dir . '/src/WPBT/WPBT_Beta_RC.php';
require_once $this->dir . '/src/WPBT/WPBT_Help.php';
require_once $this->dir . '/vendor/WPConfigTransformer.php';
}
}
38 changes: 38 additions & 0 deletions src/WPBT/WPBT_Help.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* WordPress Beta Tester
*
* @package WordPress_Beta_Tester
* @author Andy Fragen and Paul Biron, original author Peter Westwood.
* @license GPLv2+
* @copyright 2009-2016 Peter Westwood (email : peter.westwood@ftwr.co.uk)
*/

/**
* WPBT Help
*/
class WPBT_Help {
/**
* Load hooks for screen help tabs.
*
* @return void
*/
public function load_hooks() {
add_action( 'current_screen', array( $this, 'add_help_tabs' ) );
}

/**
* Add individual help tabs.
*
* @return void
*/
public function add_help_tabs() {
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => '<p>' . __( 'This screen provides help information for the Beta Tester plugin.', 'wordpress-beta-tester' ) . '</p>',
)
);
}
}
3 changes: 3 additions & 0 deletions src/WPBT/WPBT_Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function run() {
$wpbt_extras->load_hooks();
// TODO: ( new WPBT_Extras( $this->wp_beta_tester, self::$options ) )->skip_autoupdate_email();
$wpbt_extras->skip_autoupdate_email();
// TODO: ( new WPBT_Help() )->load_hooks();
$wpbt_help = new WPBT_Help();
$wpbt_help->load_hooks();
}

/**
Expand Down

0 comments on commit 40c7038

Please sign in to comment.