Title: WP_REST_Terms_Controller::create_item_permissions_check
Published: December 6, 2016
Last modified: May 20, 2026

---

# WP_REST_Terms_Controller::create_item_permissions_check( WP_REST_Request $request ): bool|󠀁[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)󠁿

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#changelog)

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

Checks if a request has access to create a term.

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

 `$request`[WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/)
required

Full details about the request.

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

 bool|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/) True
if the request has access to create items, otherwise false or [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
object.

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

    ```php
    public function create_item_permissions_check( $request ) {

    	if ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {
    		return false;
    	}

    	$taxonomy_obj = get_taxonomy( $this->taxonomy );

    	if ( ( is_taxonomy_hierarchical( $this->taxonomy )
    			&& ! current_user_can( $taxonomy_obj->cap->edit_terms ) )
    		|| ( ! is_taxonomy_hierarchical( $this->taxonomy )
    			&& ! current_user_can( $taxonomy_obj->cap->assign_terms ) ) ) {
    		return new WP_Error(
    			'rest_cannot_create',
    			__( 'Sorry, you are not allowed to create terms in this taxonomy.' ),
    			array( 'status' => rest_authorization_required_code() )
    		);
    	}

    	return true;
    }
    ```

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

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

| Uses | Description | 
| [WP_REST_Terms_Controller::check_is_taxonomy_allowed()](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/check_is_taxonomy_allowed/)`wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php` |

Checks that the taxonomy is valid.

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

Determines whether the taxonomy object is hierarchical.

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

Returns a contextual HTTP error code for authorization failure.

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

Returns whether the current user has the specified capability.

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

Retrieves the translation of $text.

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

Retrieves the taxonomy object of $taxonomy.

  | 
| [WP_Error::__construct()](https://developer.wordpress.org/reference/classes/wp_error/__construct/)`wp-includes/class-wp-error.php` |

Initializes the error.

  |

[Show 5 more](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/create_item_permissions_check/?output_format=md#)

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

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.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_terms_controller%2Fcreate_item_permissions_check%2F)
before being able to contribute a note or feedback.