Title: WP_MS_Themes_List_Table::column_autoupdates
Published: August 11, 2020
Last modified: August 20, 2026

---

# WP_MS_Themes_List_Table::column_autoupdates( WP_Theme $theme )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#wp--skip-link--target)

Handles the auto-updates column output.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#parameters)󠁿

 `$theme`[WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/)
required

The current [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/)
object.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#source)󠁿

    ```php
    public function column_autoupdates( $theme ) {
    	global $status, $page;

    	static $auto_updates, $available_updates;

    	if ( ! $auto_updates ) {
    		$auto_updates = (array) get_site_option( 'auto_update_themes', array() );
    	}
    	if ( ! $available_updates ) {
    		$available_updates = get_site_transient( 'update_themes' );
    	}

    	$stylesheet = $theme->get_stylesheet();

    	if ( isset( $theme->auto_update_forced ) ) {
    		if ( $theme->auto_update_forced ) {
    			// Forced on.
    			$text = __( 'Auto-updates enabled' );
    		} else {
    			$text = __( 'Auto-updates disabled' );
    		}
    		$action     = 'unavailable';
    		$time_class = ' hidden';
    	} elseif ( empty( $theme->update_supported ) ) {
    		$text       = '';
    		$action     = 'unavailable';
    		$time_class = ' hidden';
    	} elseif ( in_array( $stylesheet, $auto_updates, true ) ) {
    		$text       = __( 'Disable auto-updates' );
    		$action     = 'disable';
    		$time_class = '';
    	} else {
    		$text       = __( 'Enable auto-updates' );
    		$action     = 'enable';
    		$time_class = ' hidden';
    	}

    	$query_args = array(
    		'action'       => "{$action}-auto-update",
    		'theme'        => $stylesheet,
    		'paged'        => $page,
    		'theme_status' => $status,
    	);

    	$url = add_query_arg( $query_args, 'themes.php' );

    	if ( 'unavailable' === $action ) {
    		$html[] = '<span class="label">' . $text . '</span>';
    	} else {
    		$html[] = sprintf(
    			'<a href="%s" class="toggle-auto-update aria-button-if-js" data-wp-action="%s">',
    			wp_nonce_url( $url, 'updates' ),
    			$action
    		);

    		$html[] = '<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>';
    		$html[] = '<span class="label">' . $text . '</span>';
    		$html[] = '</a>';

    	}

    	if ( isset( $available_updates->response[ $stylesheet ] ) ) {
    		$html[] = sprintf(
    			'<div class="auto-update-time%s">%s</div>',
    			$time_class,
    			wp_get_auto_update_message()
    		);
    	}

    	$html = implode( '', $html );

    	/**
    	 * Filters the HTML of the auto-updates setting for each theme in the Themes list table.
    	 *
    	 * @since 5.5.0
    	 *
    	 * @param string   $html       The HTML for theme's auto-update setting, including
    	 *                             toggle auto-update action link and time to next update.
    	 * @param string   $stylesheet Directory name of the theme.
    	 * @param WP_Theme $theme      WP_Theme object.
    	 */
    	echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme );

    	wp_admin_notice(
    		'',
    		array(
    			'type'               => 'error',
    			'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ),
    		)
    	);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-ms-themes-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/class-wp-ms-themes-list-table.php#L806)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-ms-themes-list-table.php#L806-L896)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#hooks)󠁿

 [apply_filters( ‘theme_auto_update_setting_html’, string $html, string $stylesheet, WP_Theme $theme )](https://developer.wordpress.org/reference/hooks/theme_auto_update_setting_html/)

Filters the HTML of the auto-updates setting for each theme in the Themes list table.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_admin_notice()](https://developer.wordpress.org/reference/functions/wp_admin_notice/)`wp-includes/functions.php` |

Outputs an admin notice.

  | 
| [wp_get_auto_update_message()](https://developer.wordpress.org/reference/functions/wp_get_auto_update_message/)`wp-admin/includes/update.php` |

Determines the appropriate auto-update message to be displayed.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  | 
| [add_query_arg()](https://developer.wordpress.org/reference/functions/add_query_arg/)`wp-includes/functions.php` |

Retrieves a modified URL query string.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_site_transient()](https://developer.wordpress.org/reference/functions/get_site_transient/)`wp-includes/option.php` |

Retrieves the value of a site transient.

  | 
| [get_site_option()](https://developer.wordpress.org/reference/functions/get_site_option/)`wp-includes/option.php` |

Retrieve an option value for the current network based on name of option.

  |

[Show 6 more](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#)

| Used by | Description | 
| [WP_MS_Themes_List_Table::single_row_columns()](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/single_row_columns/)`wp-admin/includes/class-wp-ms-themes-list-table.php` |

Handles the output for a single table row.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_ms_themes_list_table/column_autoupdates/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_ms_themes_list_table%2Fcolumn_autoupdates%2F)
before being able to contribute a note or feedback.