WC_REST_System_Status_V2_Controller::get_item_mappings_per_fields()publicWC 3.9.0

Return an array of sections and the data associated with each.

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

Хуков нет.

Возвращает

Массив.

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

$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller();
$WC_REST_System_Status_V2_Controller->get_item_mappings_per_fields( $fields );
$fields(массив) (обязательный)
List of fields to be included on the response.

Список изменений

С версии 3.9.0 Введена.

Код WC_REST_System_Status_V2_Controller::get_item_mappings_per_fields() WC 8.7.0

public function get_item_mappings_per_fields( $fields ) {
	$items = array();

	foreach ( $fields as $field ) {
		// If we're looking for a sub-property, like environment.version we need
		// to extract the first-level property here so we know which function to run.
		list( $prop ) = explode( '.', $field, 2 );
		switch ( $prop ) {
			case 'environment':
				$items['environment'] = $this->get_environment_info_per_fields( $fields );
				break;
			case 'database':
				$items['database'] = $this->get_database_info();
				break;
			case 'active_plugins':
				$items['active_plugins'] = $this->get_active_plugins();
				break;
			case 'inactive_plugins':
				$items['inactive_plugins'] = $this->get_inactive_plugins();
				break;
			case 'dropins_mu_plugins':
				$items['dropins_mu_plugins'] = $this->get_dropins_mu_plugins();
				break;
			case 'theme':
				$items['theme'] = $this->get_theme_info();
				break;
			case 'settings':
				$items['settings'] = $this->get_settings();
				break;
			case 'security':
				$items['security'] = $this->get_security_info();
				break;
			case 'pages':
				$items['pages'] = $this->get_pages();
				break;
			case 'post_type_counts':
				$items['post_type_counts'] = $this->get_post_type_counts();
				break;
			case 'logging':
				$items['logging'] = $this->get_logging_info();
				break;
		}
	}

	return $items;
}