Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Add help tabs on update-core, plugins, and themes admin screens #121

Merged
merged 4 commits into from
May 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1353,3 +1353,56 @@ function wp_autoupdates_toggle_auto_updates() {
wp_send_json_success();
}
add_action( 'wp_ajax_toggle_auto_updates', 'wp_autoupdates_toggle_auto_updates' );

/**
* Set up auto-updates help tabs.
*/
function wp_autoupdates_help_tab_update_core() {
$screen = get_current_screen();

if ( 'update-core' === $screen->id || 'update-core-network' === $screen->id ) {
$help_tab_content = '<p>' . __( 'Plugins and Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>';
$help_tab_content .= '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>';
$help_tab_content .= '<p>' . sprintf(
audrasjb marked this conversation as resolved.
Show resolved Hide resolved
__( 'For more information: <a href="%s">Documentation about auto-updates</a>', 'wp-autoupdates' ),
'https://wordpress.org/support/article/auto-updates/'
) . '<p>';
$screen->add_help_tab( array(
'id' => 'auto-updates',
'title' => __( 'Auto-updates', 'wp-autoupdates' ),
audrasjb marked this conversation as resolved.
Show resolved Hide resolved
'content' => $help_tab_content,
'priority' => 11,
audrasjb marked this conversation as resolved.
Show resolved Hide resolved
) );
}

if ( 'plugins' === $screen->id || 'plugins-network' === $screen->id ) {
audrasjb marked this conversation as resolved.
Show resolved Hide resolved
$help_tab_content = '<p>' . __( 'Auto-updates can be enabled and disabled on a plugin by plugin basis. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>';
$help_tab_content .= '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>';
$help_tab_content .= '<p>' . sprintf(
__( 'For more information: <a href="%s">Documentation about auto-updates</a>', 'wp-autoupdates' ),
'https://wordpress.org/support/article/auto-updates/'
) . '<p>';
$screen->add_help_tab( array(
'id' => 'auto-updates',
'title' => __( 'Auto-updates', 'wp-autoupdates' ),
'content' => $help_tab_content,
'priority' => 11,
) );
}

if ( 'themes' === $screen->id || 'themes-network' === $screen->id ) {
$help_tab_content = '<p>' . __( 'Auto-updates can be enabled and disabled on a theme by theme basis. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates schedule depends on WordPress planned tasks.' ) . '</p>';
$help_tab_content .= '<p>' . __( 'Please note: WordPress auto-updates may be overridden by third-parties plugins or custom code.' ) . '</p>';
$help_tab_content .= '<p>' . sprintf(
__( 'For more information: <a href="%s">Documentation about auto-updates</a>', 'wp-autoupdates' ),
'https://wordpress.org/support/article/auto-updates/'
) . '<p>';
$screen->add_help_tab( array(
'id' => 'auto-updates',
'title' => __( 'Auto-updates', 'wp-autoupdates' ),
'content' => $help_tab_content,
'priority' => 11,
) );
}
}
add_action( 'current_screen', 'wp_autoupdates_help_tab_update_core' );