| 1 |
<?php |
| 2 |
/** |
| 3 |
* WordPress Beta Tester |
| 4 |
* |
| 5 |
* @package WordPress_Beta_Tester |
| 6 |
* @author Andy Fragen and Paul Biron, original author Peter Westwood. |
| 7 |
* @license GPLv2+ |
| 8 |
* @copyright 2009-2016 Peter Westwood (email : peter.westwood@ftwr.co.uk) |
| 9 |
*/ |
| 10 |
|
| 11 |
/** |
| 12 |
* WPBT Help |
| 13 |
*/ |
| 14 |
class WPBT_Help { |
| 15 |
/** |
| 16 |
* Load hooks for screen help tabs. |
| 17 |
* |
| 18 |
* @return void |
| 19 |
*/ |
| 20 |
public function load_hooks() { |
| 21 |
add_action( 'current_screen', array( $this, 'add_help_tabs' ) ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Add individual help tabs. |
| 26 |
* |
| 27 |
* @return bool|void |
| 28 |
*/ |
| 29 |
public function add_help_tabs() { |
| 30 |
$current_screen = get_current_screen(); |
| 31 |
if ( false === strpos( $current_screen->id, 'wp-beta-tester' ) ) { |
| 32 |
return false; |
| 33 |
} |
| 34 |
|
| 35 |
get_current_screen()->set_help_sidebar( |
| 36 |
'<p><strong>' . __( 'For more information:', 'wordpress-beta-tester' ) . '</strong></p>' |
| 37 |
. '<p>' . __( '<a href="https://make.wordpress.org/core/handbook/testing/beta-testing/">Beta Testing</a>', 'wordpress-beta-tester' ) . '</p>' |
| 38 |
); |
| 39 |
|
| 40 |
get_current_screen()->add_help_tab( |
| 41 |
array( |
| 42 |
'id' => 'overview', |
| 43 |
'title' => __( 'Overview', 'wordpress-beta-tester' ), |
| 44 |
'content' => '<p>' |
| 45 |
. sprintf( |
| 46 |
/* translators: 1: link to backing up database, 2: link to make.wp.org/core, 3: link to beta support forum */ |
| 47 |
__( 'By their nature, these releases are unstable and should not be used any place where your data is important. So please <a href="%1$s">back up your database</a> before upgrading to a test release. In order to hear about the latest beta releases, your best bet is to watch the <a href="%2$s">development blog</a> and the <a href="%3$s">beta forum</a>.', 'wordpress-beta-tester' ), |
| 48 |
_x( 'https://wordpress.org/support/article/wordpress-backups/', 'URL to database backup instructions on HelpHub', 'wordpress-beta-tester' ), |
| 49 |
'https://make.wordpress.org/core/', |
| 50 |
_x( 'https://wordpress.org/support/forum/alphabeta', 'URL to beta support forum', 'wordpress-beta-tester' ) |
| 51 |
) . '</p>', |
| 52 |
) |
| 53 |
); |
| 54 |
|
| 55 |
get_current_screen()->add_help_tab( |
| 56 |
array( |
| 57 |
'id' => 'beta/RC', |
| 58 |
'title' => __( 'Beta/RC', 'wordpress-beta-tester' ), |
| 59 |
'content' => '<p>' |
| 60 |
. __( 'You must select either the <em>Point release</em> or <em>Bleeding edge</em> channel. Then select the <em>Beta/RC Only</em> or <em>Release Candidates Only</em> stream. Once saved you will only see an update notice when the next release, RC, or beta is available.', 'wordpress-beta-tester' ) . '</p><p>' |
| 61 |
. __( '<em>Point release</em> channel only has the <em>Nightlies</em> stream available at this time.', 'wordpress-beta-tester' ) . '</p>', |
| 62 |
) |
| 63 |
); |
| 64 |
|
| 65 |
get_current_screen()->add_help_tab( |
| 66 |
array( |
| 67 |
'id' => 'dashboard', |
| 68 |
'title' => __( 'Dashboard Widget', 'wordpress-beta-tester' ), |
| 69 |
'content' => '<p>' . __( 'A dashboard widget is displayed when the plugin is active. It will contain links to milestone commits and filing a bug report. It may contain links to Dev Notes, the Field Guide, and beta/RC release posts.', 'wordpress-beta-tester' ) . '</p>', |
| 70 |
) |
| 71 |
); |
| 72 |
} |
| 73 |
} |
| 74 |
|