WP_MS_Themes_List_Table::get_bulk_actionsprotectedWP 1.0

Gets the list of bulk actions for the list table.

Метод класса: WP_MS_Themes_List_Table{}

Хуков нет.

Возвращает

Массив<Строку,. string> The list of bulk actions.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_bulk_actions();

Заметки

  • Global. Строка. $status The current theme status.

Код WP_MS_Themes_List_Table::get_bulk_actions() WP 7.0.4

protected function get_bulk_actions() {
	global $status;

	$actions = array();
	if ( 'enabled' !== $status ) {
		$actions['enable-selected'] = $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' );
	}
	if ( 'disabled' !== $status ) {
		$actions['disable-selected'] = $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' );
	}
	if ( ! $this->is_site_themes ) {
		if ( current_user_can( 'update_themes' ) ) {
			$actions['update-selected'] = __( 'Update' );
		}
		if ( current_user_can( 'delete_themes' ) ) {
			$actions['delete-selected'] = __( 'Delete' );
		}
	}

	if ( $this->show_autoupdates ) {
		if ( 'auto-update-enabled' !== $status ) {
			$actions['enable-auto-update-selected'] = __( 'Enable Auto-updates' );
		}

		if ( 'auto-update-disabled' !== $status ) {
			$actions['disable-auto-update-selected'] = __( 'Disable Auto-updates' );
		}
	}

	return $actions;
}