LLMS_Post_Types::get_tax_caps( string|array $tax )
Retrieve taxonomy capabilities for custom taxonomies
Parameters Parameters
- $tax
-
(string|array) (Required) Taxonomy name/names (pass array of singular, plural to customize plural spelling).
Return Return
(array)
Source Source
File: includes/class.llms.post-types.php
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | public static function get_tax_caps( $tax ) { if ( ! is_array ( $tax ) ) { $singular = $tax ; $plural = $tax . 's' ; } else { $singular = $tax [0]; $plural = $tax [1]; } /** * Customize the taxonomy capabilities for the given taxonomy. * * The dynamic portion of this hook, `$singular` refers to the taxonomy's * registered name. * * @since 3.13.0 * * @param array $caps Array of capabilities. */ return apply_filters( "llms_get_{$singular}_tax_caps" , array ( 'manage_terms' => sprintf( 'manage_%s' , $plural ), 'edit_terms' => sprintf( 'edit_%s' , $plural ), 'delete_terms' => sprintf( 'delete_%s' , $plural ), 'assign_terms' => sprintf( 'assign_%s' , $plural ), ) ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.13.0 | Introduced. |