wp_theme_auto_update_setting_template

The timeline below displays how wordpress function wp_theme_auto_update_setting_template has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Returns the JavaScript template used to display the auto-update setting for a theme.
 *
 * @since 5.5.0
 *
 * @return string The template for displaying the auto-update setting link.
 */
function wp_theme_auto_update_setting_template()
{
    $notice = wp_get_admin_notice('', array('type' => 'error', 'additional_classes' => array('notice-alt', 'inline', 'hidden')));
    $template = '
		<div class="theme-autoupdate">
			<# if ( data.autoupdate.supported ) { #>
				<# if ( data.autoupdate.forced === false ) { #>
					' . __('Auto-updates disabled') . '
				<# } else if ( data.autoupdate.forced ) { #>
					' . __('Auto-updates enabled') . '
				<# } else if ( data.autoupdate.enabled ) { #>
					<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable">
						<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __('Disable auto-updates') . '</span>
					</button>
				<# } else { #>
					<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable">
						<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __('Enable auto-updates') . '</span>
					</button>
				<# } #>
			<# } #>
			<# if ( data.hasUpdate ) { #>
				<# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #>
					<span class="auto-update-time">
				<# } else { #>
					<span class="auto-update-time hidden">
				<# } #>
				<br />' . wp_get_auto_update_message() . '</span>
			<# } #>
			' . $notice . '
		</div>
	';
    /**
     * Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay).
     *
     * See {@see wp_prepare_themes_for_js()} for the properties of the `data` object.
     *
     * @since 5.5.0
     *
     * @param string $template The template for displaying the auto-update setting link.
     */
    return apply_filters('theme_auto_update_setting_template', $template);
}

WordPress Version: 5.5

/**
 * Returns the JavaScript template used to display the auto-update setting for a theme.
 *
 * @since 5.5.0
 *
 * @return string The template for displaying the auto-update setting link.
 */
function wp_theme_auto_update_setting_template()
{
    $template = '
		<div class="theme-autoupdate">
			<# if ( data.autoupdate.supported ) { #>
				<# if ( data.autoupdate.forced === false ) { #>
					' . __('Auto-updates disabled') . '
				<# } else if ( data.autoupdate.forced ) { #>
					' . __('Auto-updates enabled') . '
				<# } else if ( data.autoupdate.enabled ) { #>
					<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable">
						<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __('Disable auto-updates') . '</span>
					</button>
				<# } else { #>
					<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable">
						<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __('Enable auto-updates') . '</span>
					</button>
				<# } #>
			<# } #>
			<# if ( data.hasUpdate ) { #>
				<# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #>
					<span class="auto-update-time">
				<# } else { #>
					<span class="auto-update-time hidden">
				<# } #>
				<br />' . wp_get_auto_update_message() . '</span>
			<# } #>
			<div class="notice notice-error notice-alt inline hidden"><p></p></div>
		</div>
	';
    /**
     * Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay).
     *
     * See {@see wp_prepare_themes_for_js()} for the properties of the `data` object.
     *
     * @since 5.5.0
     *
     * @param string $template The template for displaying the auto-update setting link.
     */
    return apply_filters('theme_auto_update_setting_template', $template);
}