view_mode_post_types
Filters the post types that have different view mode options.
Description
Parameters (1)
- 0. $view_mode_post_types (array)
- Array of post types that can change view modes. Default hierarchical post types with show_ui on.
Usage
- To run the hook, copy the example below.
- $view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );
- if ( !empty( $view_mode_post_types ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the view_mode_post_types callback
- function filter_view_mode_post_types( $view_mode_post_types ) {
- // make filter magic happen here...
- return $view_mode_post_types;
- };
- // add the filter
- add_filter( 'view_mode_post_types', 'filter_view_mode_post_types', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'view_mode_post_types', 'filter_view_mode_post_types', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/class-wp-screen.php
- $view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );