WP_Plugins_List_Table::get_bulk_actions() WordPress Method

The WP_Plugins_List_Table::get_bulk_actions() method is used to get the bulk actions that are available for the plugin list table.

WP_Plugins_List_Table::get_bulk_actions() #


Return

(array)


Top ↑

Source

File: wp-admin/includes/class-wp-plugins-list-table.php

	protected function get_bulk_actions() {
		global $status;

		$actions = array();

		if ( 'active' !== $status ) {
			$actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
		}

		if ( 'inactive' !== $status && 'recent' !== $status ) {
			$actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
		}

		if ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) {
			if ( current_user_can( 'update_plugins' ) ) {
				$actions['update-selected'] = __( 'Update' );
			}

			if ( current_user_can( 'delete_plugins' ) && ( 'active' !== $status ) ) {
				$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;
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.