PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.8
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.8
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / apps / pages / pages.os.php

pages.os.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.8, at apps/pages/pages.os.php

83 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Pages — the native Pages window, as an OpenStation app.
4 *
5 * Claims the FROZEN window id `desktop-mode-pages` (see AGENTS.md).
6 * The Posts app's twin over `/wp/v2/pages`: hierarchical (a Parent
7 * column, `menu_order` by default), a Template / Slug / Comments
8 * column set, front-page and posts-page badges, and no taxonomy tabs.
9 * The list machinery is shared with the Posts app — this entry
10 * requires `apps/posts/parts/query.php` and `pages.os.ts` composes the
11 * same client parts (sanctioned cross-app reuse, noted in both).
12 *
13 * (Header kept short on purpose: Plugin Check's direct-access scan
14 * reads only the first 50 raw lines, and the guard must land inside.)
15 *
16 * @package OpenStation
17 */
18
19 namespace OpenStation\Apps\Pages;
20
21 use OpenStation\App;
22 use OpenStation\App\Os;
23 use OpenStation\App\State;
24
25 // Direct access, unless a standalone host is booting on bare PHP.
26 if ( ! defined( 'ABSPATH' ) ) {
27 defined( 'OPENSTATION_STANDALONE' ) || exit;
28 }
29
30 require_once __DIR__ . '/parts/permissions.php';
31 require_once __DIR__ . '/parts/query.php';
32 require_once dirname( __DIR__ ) . '/posts/parts/query.php';
33
34 return App::define( 'desktop-mode-pages' )
35 ->title( __( 'Pages', 'desktop-mode' ) )
36 ->icon( 'dashicons-admin-page' )
37 ->size( 1100, 720 )
38 ->min_size( 720, 480 )
39 // The Pages dock tile is WordPress's own; the shell's URL remap
40 // routes `edit.php?post_type=page` here under `nativePagesEnabled`.
41 ->placement( 'none' )
42 ->can(
43 static function () {
44 return openstation_pages_window_user_can_register();
45 }
46 )
47 ->config(
48 static function () {
49 return openstation_pages_app_config();
50 }
51 )
52 ->state( openstation_posts_app_state( 'menu_order', 'asc' ) )
53 ->action(
54 'filter',
55 static function ( State $state ) {
56 openstation_posts_app_filter( $state );
57 }
58 )
59 ->action(
60 'page',
61 static function ( State $state, Os $os, array $args ) {
62 openstation_posts_app_page( $state, $args );
63 }
64 )
65 ->action(
66 'sort',
67 static function ( State $state, Os $os, array $args ) {
68 openstation_posts_app_sort( $state, $args, 'menu_order', 'asc' );
69 }
70 )
71 ->action(
72 'trash',
73 static function ( State $state, Os $os, array $args ) {
74 openstation_posts_app_trash( $os, $args, 'page' );
75 }
76 )
77 ->watch( 'page' )
78 ->data(
79 static function ( State $state ) {
80 return openstation_posts_app_data( 'wp/v2/pages', openstation_pages_window_default_query_args(), $state );
81 }
82 );
83