Title: WP_REST_Themes_Controller::get_collection_params
Published: December 6, 2018
Last modified: February 24, 2026

---

# WP_REST_Themes_Controller::get_collection_params(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_collection_params/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_collection_params/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_collection_params/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_collection_params/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_collection_params/?output_format=md#changelog)

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

Retrieves the search params for the themes collection.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_collection_params/?output_format=md#return)󠁿

 array Collection parameters.

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

    ```php
    public function get_collection_params() {
    	$query_params = array(
    		'status' => array(
    			'description' => __( 'Limit result set to themes assigned one or more statuses.' ),
    			'type'        => 'array',
    			'items'       => array(
    				'enum' => array( 'active', 'inactive' ),
    				'type' => 'string',
    			),
    		),
    	);

    	/**
    	 * Filters REST API collection parameters for the themes controller.
    	 *
    	 * @since 5.0.0
    	 *
    	 * @param array $query_params JSON Schema-formatted collection parameters.
    	 */
    	return apply_filters( 'rest_themes_collection_params', $query_params );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php#L714)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php#L714-L734)

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

 [apply_filters( ‘rest_themes_collection_params’, array $query_params )](https://developer.wordpress.org/reference/hooks/rest_themes_collection_params/)

Filters REST API collection parameters for the themes controller.

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

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

Retrieves the translation of $text.

  | 
| [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.

  |

| Used by | Description | 
| [WP_REST_Themes_Controller::register_routes()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/register_routes/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Registers the routes for themes.

  | 
| [WP_REST_Themes_Controller::get_items_permissions_check()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_items_permissions_check/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Checks if a given request has access to read the theme.

  |

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

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

## User Contributed Notes

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