wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_wp_get_entity_view_config_posttype_page › WordPress Function
Seit7.1.0
Veraltetn/v
› _wp_get_entity_view_config_posttype_page ( $data )
| Parameter: |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Provides the view configuration for the `page` post type.
Quellcode
function _wp_get_entity_view_config_posttype_page( $data ) {
$default_layouts = array(
'table' => array(
'layout' => array(
'styles' => array(
'author' => array(
'align' => 'start',
),
),
),
),
'grid' => array(),
'list' => array(),
);
$default_view = array(
'type' => 'list',
'filters' => array(),
'perPage' => 20,
'sort' => array(
'field' => 'title',
'direction' => 'asc',
),
'showLevels' => true,
'titleField' => 'title',
'mediaField' => 'featured_media',
'fields' => array( 'author', 'status' ),
);
$view_list = array(
array(
'title' => __( 'Published' ),
'slug' => 'published',
'view' => array(
'filters' => array(
array(
'field' => 'status',
'operator' => 'isAny',
'value' => 'publish',
'isLocked' => true,
),
),
),
),
array(
'title' => __( 'Scheduled' ),
'slug' => 'future',
'view' => array(
'filters' => array(
array(
'field' => 'status',
'operator' => 'isAny',
'value' => 'future',
'isLocked' => true,
),
),
),
),
array(
'title' => __( 'Drafts' ),
'slug' => 'drafts',
'view' => array(
'filters' => array(
array(
'field' => 'status',
'operator' => 'isAny',
'value' => 'draft',
'isLocked' => true,
),
),
),
),
array(
'title' => __( 'Pending' ),
'slug' => 'pending',
'view' => array(
'filters' => array(
array(
'field' => 'status',
'operator' => 'isAny',
'value' => 'pending',
'isLocked' => true,
),
),
),
),
array(
'title' => __( 'Private' ),
'slug' => 'private',
'view' => array(
'filters' => array(
array(
'field' => 'status',
'operator' => 'isAny',
'value' => 'private',
'isLocked' => true,
),
),
),
),
array(
'title' => __( 'Trash' ),
'slug' => 'trash',
'view' => array(
'type' => 'table',
'layout' => $default_layouts['table']['layout'],
'filters' => array(
array(
'field' => 'status',
'operator' => 'isAny',
'value' => 'trash',
'isLocked' => true,
),
),
),
),
);
$data->set(
array(
'default_view' => $default_view,
'default_layouts' => $default_layouts,
),
1
);
// Append the status views, thereby preserving the base "all items" view,
// so its post-type-specific title is kept.
$data->merge( array( 'view_list' => $view_list ), 1 );
return $data;
}