Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_theme_auto_update_setting_template ›

Seit5.5.0
Veraltetn/v
wp_theme_auto_update_setting_template ( Keine Parameter )
Gibt zurück:
  • (string) The template for displaying the auto-update setting link.
Definiert in:
Codex:

Returns the JavaScript template used to display the auto-update setting for a theme.



Quellcode

function wp_theme_auto_update_setting_template() {
	$template = '
		<div class="theme-autoupdate">
			<# if ( data.autoupdate ) { #>
				<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 ) { #>
					<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 );
}