title( __( 'Pages', 'desktop-mode' ) ) ->icon( 'dashicons-admin-page' ) ->size( 1100, 720 ) ->min_size( 720, 480 ) // The Pages dock tile is WordPress's own; the shell's URL remap // routes `edit.php?post_type=page` here under `nativePagesEnabled`. ->placement( 'none' ) ->can( static function () { return openstation_pages_window_user_can_register(); } ) ->config( static function () { return openstation_pages_app_config(); } ) ->state( openstation_posts_app_state( 'menu_order', 'asc' ) ) // Same as Posts. Page atlas is the case the declaration exists // for: a tab wp-admin has no screen for, which the dock now // offers as a row because this list says so. ->menu( 'edit.php?post_type=page', static function () { return array( 'posts' => array( 'label' => __( 'All pages', 'desktop-mode' ), 'page' => 'edit.php?post_type=page', ), 'new' => array( 'label' => __( 'Add Page', 'desktop-mode' ), 'page' => 'post-new.php?post_type=page', ), // No wp-admin page behind this one; the dock offers it // because this list says so. 'atlas' => __( 'Page atlas', 'desktop-mode' ), ); }, 'openstation_pages_window_user_can_use' ) ->action( 'filter', static function ( State $state ) { openstation_posts_app_filter( $state ); } ) ->action( 'page', static function ( State $state, Os $os, array $args ) { openstation_posts_app_page( $state, $args ); } ) ->action( 'sort', static function ( State $state, Os $os, array $args ) { openstation_posts_app_sort( $state, $args, 'menu_order', 'asc' ); } ) ->action( 'trash', static function ( State $state, Os $os, array $args ) { openstation_posts_app_trash( $os, $args, 'page' ); } ) ->watch( 'page' ) ->data( static function ( State $state ) { return openstation_posts_app_data( 'wp/v2/pages', openstation_pages_window_default_query_args(), $state ); } );