author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
3 |
* List Table API: WP_Posts_List_Table class |
0 | 4 |
* |
5 |
* @package WordPress |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
6 |
* @subpackage Administration |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
7 |
* @since 3.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
8 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
9 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
10 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
11 |
* Core class used to implement displaying posts in a list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
12 |
* |
0 | 13 |
* @since 3.1.0 |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
14 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
* @see WP_List_Table |
0 | 16 |
*/ |
17 |
class WP_Posts_List_Table extends WP_List_Table { |
|
18 |
||
19 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
20 |
* Whether the items should be displayed hierarchically or linearly. |
0 | 21 |
* |
22 |
* @since 3.1.0 |
|
23 |
* @var bool |
|
24 |
*/ |
|
5 | 25 |
protected $hierarchical_display; |
0 | 26 |
|
27 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
* Holds the number of pending comments for each post. |
0 | 29 |
* |
30 |
* @since 3.1.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
31 |
* @var array |
0 | 32 |
*/ |
5 | 33 |
protected $comment_pending_count; |
0 | 34 |
|
35 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
* Holds the number of posts for this user. |
0 | 37 |
* |
38 |
* @since 3.1.0 |
|
39 |
* @var int |
|
40 |
*/ |
|
5 | 41 |
private $user_posts_count; |
0 | 42 |
|
43 |
/** |
|
44 |
* Holds the number of posts which are sticky. |
|
45 |
* |
|
46 |
* @since 3.1.0 |
|
47 |
* @var int |
|
48 |
*/ |
|
5 | 49 |
private $sticky_posts_count = 0; |
50 |
||
51 |
private $is_trash; |
|
0 | 52 |
|
5 | 53 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
54 |
* Current level for output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
55 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
56 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
57 |
* @var int |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
protected $current_level = 0; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
60 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
61 |
/** |
5 | 62 |
* Constructor. |
63 |
* |
|
64 |
* @since 3.1.0 |
|
65 |
* |
|
66 |
* @see WP_List_Table::__construct() for more information on default arguments. |
|
67 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
68 |
* @global WP_Post_Type $post_type_object Global post type object. |
16 | 69 |
* @global wpdb $wpdb WordPress database abstraction object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
70 |
* |
5 | 71 |
* @param array $args An associative array of arguments. |
72 |
*/ |
|
73 |
public function __construct( $args = array() ) { |
|
0 | 74 |
global $post_type_object, $wpdb; |
75 |
||
9 | 76 |
parent::__construct( |
77 |
array( |
|
78 |
'plural' => 'posts', |
|
79 |
'screen' => isset( $args['screen'] ) ? $args['screen'] : null, |
|
80 |
) |
|
81 |
); |
|
0 | 82 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
83 |
$post_type = $this->screen->post_type; |
0 | 84 |
$post_type_object = get_post_type_object( $post_type ); |
85 |
||
18 | 86 |
$exclude_states = get_post_stati( |
9 | 87 |
array( |
88 |
'show_in_admin_all_list' => false, |
|
89 |
) |
|
90 |
); |
|
18 | 91 |
|
92 |
$this->user_posts_count = (int) $wpdb->get_var( |
|
93 |
$wpdb->prepare( |
|
94 |
"SELECT COUNT( 1 ) |
|
95 |
FROM $wpdb->posts |
|
96 |
WHERE post_type = %s |
|
97 |
AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) |
|
98 |
AND post_author = %d", |
|
99 |
$post_type, |
|
100 |
get_current_user_id() |
|
9 | 101 |
) |
102 |
); |
|
0 | 103 |
|
18 | 104 |
if ( $this->user_posts_count |
105 |
&& ! current_user_can( $post_type_object->cap->edit_others_posts ) |
|
106 |
&& empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) |
|
107 |
&& empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) |
|
108 |
) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
109 |
$_GET['author'] = get_current_user_id(); |
0 | 110 |
} |
111 |
||
16 | 112 |
$sticky_posts = get_option( 'sticky_posts' ); |
18 | 113 |
|
16 | 114 |
if ( 'post' === $post_type && $sticky_posts ) { |
18 | 115 |
$sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) ); |
116 |
||
117 |
$this->sticky_posts_count = (int) $wpdb->get_var( |
|
118 |
$wpdb->prepare( |
|
119 |
"SELECT COUNT( 1 ) |
|
120 |
FROM $wpdb->posts |
|
121 |
WHERE post_type = %s |
|
122 |
AND post_status NOT IN ('trash', 'auto-draft') |
|
123 |
AND ID IN ($sticky_posts)", |
|
124 |
$post_type |
|
125 |
) |
|
126 |
); |
|
0 | 127 |
} |
128 |
} |
|
129 |
||
5 | 130 |
/** |
131 |
* Sets whether the table layout should be hierarchical or not. |
|
132 |
* |
|
133 |
* @since 4.2.0 |
|
134 |
* |
|
135 |
* @param bool $display Whether the table layout should be hierarchical. |
|
136 |
*/ |
|
137 |
public function set_hierarchical_display( $display ) { |
|
138 |
$this->hierarchical_display = $display; |
|
139 |
} |
|
140 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
141 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
142 |
* @return bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
143 |
*/ |
5 | 144 |
public function ajax_user_can() { |
0 | 145 |
return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts ); |
146 |
} |
|
147 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
148 |
/** |
16 | 149 |
* @global string $mode List table view mode. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
150 |
* @global array $avail_post_stati |
16 | 151 |
* @global WP_Query $wp_query WordPress Query object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
152 |
* @global int $per_page |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
153 |
*/ |
5 | 154 |
public function prepare_items() { |
16 | 155 |
global $mode, $avail_post_stati, $wp_query, $per_page; |
0 | 156 |
|
16 | 157 |
if ( ! empty( $_REQUEST['mode'] ) ) { |
158 |
$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list'; |
|
159 |
set_user_setting( 'posts_list_mode', $mode ); |
|
160 |
} else { |
|
161 |
$mode = get_user_setting( 'posts_list_mode', 'list' ); |
|
162 |
} |
|
163 |
||
164 |
// Is going to call wp(). |
|
0 | 165 |
$avail_post_stati = wp_edit_posts_query(); |
166 |
||
18 | 167 |
$this->set_hierarchical_display( |
168 |
is_post_type_hierarchical( $this->screen->post_type ) |
|
169 |
&& 'menu_order title' === $wp_query->query['orderby'] |
|
170 |
); |
|
0 | 171 |
|
172 |
$post_type = $this->screen->post_type; |
|
9 | 173 |
$per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' ); |
5 | 174 |
|
175 |
/** This filter is documented in wp-admin/includes/post.php */ |
|
9 | 176 |
$per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type ); |
0 | 177 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
178 |
if ( $this->hierarchical_display ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
179 |
$total_items = $wp_query->post_count; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
} elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
$total_items = $wp_query->found_posts; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
183 |
$post_counts = (array) wp_count_posts( $post_type, 'readable' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
184 |
|
16 | 185 |
if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati, true ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
186 |
$total_items = $post_counts[ $_REQUEST['post_status'] ]; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
187 |
} elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
188 |
$total_items = $this->sticky_posts_count; |
18 | 189 |
} elseif ( isset( $_GET['author'] ) && get_current_user_id() === (int) $_GET['author'] ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
190 |
$total_items = $this->user_posts_count; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
$total_items = array_sum( $post_counts ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
193 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
194 |
// Subtract post types that are not included in the admin all list. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
195 |
foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
196 |
$total_items -= $post_counts[ $state ]; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
197 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
198 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
199 |
} |
0 | 200 |
|
16 | 201 |
$this->is_trash = isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status']; |
0 | 202 |
|
9 | 203 |
$this->set_pagination_args( |
204 |
array( |
|
205 |
'total_items' => $total_items, |
|
206 |
'per_page' => $per_page, |
|
207 |
) |
|
208 |
); |
|
0 | 209 |
} |
210 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
211 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
212 |
* @return bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
213 |
*/ |
5 | 214 |
public function has_items() { |
0 | 215 |
return have_posts(); |
216 |
} |
|
217 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
218 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
219 |
*/ |
5 | 220 |
public function no_items() { |
9 | 221 |
if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { |
0 | 222 |
echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash; |
9 | 223 |
} else { |
0 | 224 |
echo get_post_type_object( $this->screen->post_type )->labels->not_found; |
9 | 225 |
} |
0 | 226 |
} |
227 |
||
5 | 228 |
/** |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
229 |
* Determines if the current view is the "All" view. |
5 | 230 |
* |
231 |
* @since 4.2.0 |
|
232 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
233 |
* @return bool Whether the current view is the "All" view. |
5 | 234 |
*/ |
235 |
protected function is_base_request() { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
236 |
$vars = $_GET; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
237 |
unset( $vars['paged'] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
238 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
239 |
if ( empty( $vars ) ) { |
5 | 240 |
return true; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
241 |
} elseif ( 1 === count( $vars ) && ! empty( $vars['post_type'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
242 |
return $this->screen->post_type === $vars['post_type']; |
5 | 243 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
244 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
245 |
return 1 === count( $vars ) && ! empty( $vars['mode'] ); |
5 | 246 |
} |
247 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
248 |
/** |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
249 |
* Creates a link to edit.php with params. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
250 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
251 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
252 |
* |
19 | 253 |
* @param string[] $args Associative array of URL parameters for the link. |
254 |
* @param string $link_text Link text. |
|
255 |
* @param string $css_class Optional. Class attribute. Default empty string. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
256 |
* @return string The formatted link string. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
257 |
*/ |
19 | 258 |
protected function get_edit_link( $args, $link_text, $css_class = '' ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
259 |
$url = add_query_arg( $args, 'edit.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
260 |
|
16 | 261 |
$class_html = ''; |
262 |
$aria_current = ''; |
|
18 | 263 |
|
19 | 264 |
if ( ! empty( $css_class ) ) { |
9 | 265 |
$class_html = sprintf( |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
266 |
' class="%s"', |
19 | 267 |
esc_attr( $css_class ) |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
268 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
269 |
|
19 | 270 |
if ( 'current' === $css_class ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
271 |
$aria_current = ' aria-current="page"'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
272 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
273 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
274 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
275 |
return sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
276 |
'<a href="%s"%s%s>%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
277 |
esc_url( $url ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
278 |
$class_html, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
279 |
$aria_current, |
19 | 280 |
$link_text |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
281 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
282 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
283 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
284 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
285 |
* @global array $locked_post_status This seems to be deprecated. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
286 |
* @global array $avail_post_stati |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
287 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
288 |
*/ |
5 | 289 |
protected function get_views() { |
0 | 290 |
global $locked_post_status, $avail_post_stati; |
291 |
||
292 |
$post_type = $this->screen->post_type; |
|
293 |
||
9 | 294 |
if ( ! empty( $locked_post_status ) ) { |
0 | 295 |
return array(); |
9 | 296 |
} |
0 | 297 |
|
298 |
$status_links = array(); |
|
9 | 299 |
$num_posts = wp_count_posts( $post_type, 'readable' ); |
300 |
$total_posts = array_sum( (array) $num_posts ); |
|
301 |
$class = ''; |
|
0 | 302 |
|
303 |
$current_user_id = get_current_user_id(); |
|
9 | 304 |
$all_args = array( 'post_type' => $post_type ); |
305 |
$mine = ''; |
|
0 | 306 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
307 |
// Subtract post types that are not included in the admin all list. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
308 |
foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
309 |
$total_posts -= $num_posts->$state; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
310 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
311 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
312 |
if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) { |
18 | 313 |
if ( isset( $_GET['author'] ) && ( $current_user_id === (int) $_GET['author'] ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
314 |
$class = 'current'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
315 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
316 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
317 |
$mine_args = array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
318 |
'post_type' => $post_type, |
9 | 319 |
'author' => $current_user_id, |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
320 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
321 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
322 |
$mine_inner_html = sprintf( |
16 | 323 |
/* translators: %s: Number of posts. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
324 |
_nx( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
325 |
'Mine <span class="count">(%s)</span>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
326 |
'Mine <span class="count">(%s)</span>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
327 |
$this->user_posts_count, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
328 |
'posts' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
329 |
), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
330 |
number_format_i18n( $this->user_posts_count ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
331 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
332 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
333 |
$mine = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
334 |
'url' => esc_url( add_query_arg( $mine_args, 'edit.php' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
335 |
'label' => $mine_inner_html, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
336 |
'current' => isset( $_GET['author'] ) && ( $current_user_id === (int) $_GET['author'] ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
337 |
); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
338 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
339 |
$all_args['all_posts'] = 1; |
9 | 340 |
$class = ''; |
0 | 341 |
} |
342 |
||
5 | 343 |
$all_inner_html = sprintf( |
16 | 344 |
/* translators: %s: Number of posts. */ |
5 | 345 |
_nx( |
346 |
'All <span class="count">(%s)</span>', |
|
347 |
'All <span class="count">(%s)</span>', |
|
348 |
$total_posts, |
|
349 |
'posts' |
|
350 |
), |
|
351 |
number_format_i18n( $total_posts ) |
|
352 |
); |
|
353 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
354 |
$status_links['all'] = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
355 |
'url' => esc_url( add_query_arg( $all_args, 'edit.php' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
356 |
'label' => $all_inner_html, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
357 |
'current' => empty( $class ) && ( $this->is_base_request() || isset( $_REQUEST['all_posts'] ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
358 |
); |
18 | 359 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
360 |
if ( $mine ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
361 |
$status_links['mine'] = $mine; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
362 |
} |
0 | 363 |
|
9 | 364 |
foreach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) { |
0 | 365 |
$class = ''; |
366 |
||
367 |
$status_name = $status->name; |
|
368 |
||
16 | 369 |
if ( ! in_array( $status_name, $avail_post_stati, true ) || empty( $num_posts->$status_name ) ) { |
0 | 370 |
continue; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
371 |
} |
0 | 372 |
|
9 | 373 |
if ( isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'] ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
374 |
$class = 'current'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
375 |
} |
0 | 376 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
377 |
$status_args = array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
378 |
'post_status' => $status_name, |
9 | 379 |
'post_type' => $post_type, |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
380 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
381 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
382 |
$status_label = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
383 |
translate_nooped_plural( $status->label_count, $num_posts->$status_name ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
384 |
number_format_i18n( $num_posts->$status_name ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
385 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
386 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
387 |
$status_links[ $status_name ] = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
388 |
'url' => esc_url( add_query_arg( $status_args, 'edit.php' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
389 |
'label' => $status_label, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
390 |
'current' => isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'], |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
391 |
); |
0 | 392 |
} |
393 |
||
394 |
if ( ! empty( $this->sticky_posts_count ) ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
395 |
$class = ! empty( $_REQUEST['show_sticky'] ) ? 'current' : ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
396 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
397 |
$sticky_args = array( |
9 | 398 |
'post_type' => $post_type, |
399 |
'show_sticky' => 1, |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
400 |
); |
0 | 401 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
402 |
$sticky_inner_html = sprintf( |
16 | 403 |
/* translators: %s: Number of posts. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
404 |
_nx( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
405 |
'Sticky <span class="count">(%s)</span>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
406 |
'Sticky <span class="count">(%s)</span>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
407 |
$this->sticky_posts_count, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
408 |
'posts' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
409 |
), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
410 |
number_format_i18n( $this->sticky_posts_count ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
412 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
413 |
$sticky_link = array( |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
414 |
'sticky' => array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
415 |
'url' => esc_url( add_query_arg( $sticky_args, 'edit.php' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
416 |
'label' => $sticky_inner_html, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
417 |
'current' => ! empty( $_REQUEST['show_sticky'] ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
418 |
), |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
419 |
); |
0 | 420 |
|
421 |
// Sticky comes after Publish, or if not listed, after All. |
|
16 | 422 |
$split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ), true ); |
0 | 423 |
$status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) ); |
424 |
} |
|
425 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
426 |
return $this->get_views_links( $status_links ); |
0 | 427 |
} |
428 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
429 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
430 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
431 |
*/ |
5 | 432 |
protected function get_bulk_actions() { |
9 | 433 |
$actions = array(); |
5 | 434 |
$post_type_obj = get_post_type_object( $this->screen->post_type ); |
0 | 435 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
436 |
if ( current_user_can( $post_type_obj->cap->edit_posts ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
437 |
if ( $this->is_trash ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
438 |
$actions['untrash'] = __( 'Restore' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
439 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
440 |
$actions['edit'] = __( 'Edit' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
441 |
} |
5 | 442 |
} |
0 | 443 |
|
5 | 444 |
if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { |
445 |
if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { |
|
16 | 446 |
$actions['delete'] = __( 'Delete permanently' ); |
5 | 447 |
} else { |
448 |
$actions['trash'] = __( 'Move to Trash' ); |
|
449 |
} |
|
450 |
} |
|
0 | 451 |
|
452 |
return $actions; |
|
453 |
} |
|
454 |
||
5 | 455 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
456 |
* Displays a categories drop-down for filtering on the Posts list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
457 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
458 |
* @since 4.6.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
459 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
460 |
* @global int $cat Currently selected category. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
461 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
462 |
* @param string $post_type Post type slug. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
463 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
464 |
protected function categories_dropdown( $post_type ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
465 |
global $cat; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
466 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
467 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
468 |
* Filters whether to remove the 'Categories' drop-down from the post list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
469 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
470 |
* @since 4.6.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
471 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
472 |
* @param bool $disable Whether to disable the categories drop-down. Default false. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
473 |
* @param string $post_type Post type slug. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
474 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
475 |
if ( false !== apply_filters( 'disable_categories_dropdown', false, $post_type ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
476 |
return; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
477 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
478 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
479 |
if ( is_object_in_taxonomy( $post_type, 'category' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
480 |
$dropdown_options = array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
481 |
'show_option_all' => get_taxonomy( 'category' )->labels->all_items, |
9 | 482 |
'hide_empty' => 0, |
483 |
'hierarchical' => 1, |
|
484 |
'show_count' => 0, |
|
485 |
'orderby' => 'name', |
|
486 |
'selected' => $cat, |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
487 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
488 |
|
18 | 489 |
echo '<label class="screen-reader-text" for="cat">' . get_taxonomy( 'category' )->labels->filter_by_item . '</label>'; |
490 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
wp_dropdown_categories( $dropdown_options ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
492 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
493 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
494 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
495 |
/** |
9 | 496 |
* Displays a formats drop-down for filtering items. |
497 |
* |
|
498 |
* @since 5.2.0 |
|
499 |
* @access protected |
|
500 |
* |
|
16 | 501 |
* @param string $post_type Post type slug. |
9 | 502 |
*/ |
503 |
protected function formats_dropdown( $post_type ) { |
|
504 |
/** |
|
505 |
* Filters whether to remove the 'Formats' drop-down from the post list table. |
|
506 |
* |
|
507 |
* @since 5.2.0 |
|
16 | 508 |
* @since 5.5.0 The `$post_type` parameter was added. |
9 | 509 |
* |
16 | 510 |
* @param bool $disable Whether to disable the drop-down. Default false. |
511 |
* @param string $post_type Post type slug. |
|
9 | 512 |
*/ |
16 | 513 |
if ( apply_filters( 'disable_formats_dropdown', false, $post_type ) ) { |
514 |
return; |
|
515 |
} |
|
516 |
||
517 |
// Return if the post type doesn't have post formats or if we're in the Trash. |
|
518 |
if ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || $this->is_trash ) { |
|
9 | 519 |
return; |
520 |
} |
|
521 |
||
522 |
// Make sure the dropdown shows only formats with a post count greater than 0. |
|
523 |
$used_post_formats = get_terms( |
|
524 |
array( |
|
525 |
'taxonomy' => 'post_format', |
|
526 |
'hide_empty' => true, |
|
527 |
) |
|
528 |
); |
|
529 |
||
16 | 530 |
// Return if there are no posts using formats. |
531 |
if ( ! $used_post_formats ) { |
|
9 | 532 |
return; |
533 |
} |
|
534 |
||
535 |
$displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : ''; |
|
536 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
537 |
<label for="filter-by-format" class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
538 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
539 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
540 |
_e( 'Filter by post format' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
541 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
542 |
</label> |
9 | 543 |
<select name="post_format" id="filter-by-format"> |
544 |
<option<?php selected( $displayed_post_format, '' ); ?> value=""><?php _e( 'All formats' ); ?></option> |
|
545 |
<?php |
|
546 |
foreach ( $used_post_formats as $used_post_format ) { |
|
547 |
// Post format slug. |
|
548 |
$slug = str_replace( 'post-format-', '', $used_post_format->slug ); |
|
549 |
// Pretty, translated version of the post format slug. |
|
550 |
$pretty_name = get_post_format_string( $slug ); |
|
18 | 551 |
|
9 | 552 |
// Skip the standard post format. |
553 |
if ( 'standard' === $slug ) { |
|
554 |
continue; |
|
555 |
} |
|
556 |
?> |
|
557 |
<option<?php selected( $displayed_post_format, $slug ); ?> value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $pretty_name ); ?></option> |
|
558 |
<?php |
|
559 |
} |
|
560 |
?> |
|
561 |
</select> |
|
562 |
<?php |
|
563 |
} |
|
564 |
||
565 |
/** |
|
5 | 566 |
* @param string $which |
567 |
*/ |
|
568 |
protected function extra_tablenav( $which ) { |
|
9 | 569 |
?> |
0 | 570 |
<div class="alignleft actions"> |
9 | 571 |
<?php |
16 | 572 |
if ( 'top' === $which ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
573 |
ob_start(); |
0 | 574 |
|
575 |
$this->months_dropdown( $this->screen->post_type ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
576 |
$this->categories_dropdown( $this->screen->post_type ); |
9 | 577 |
$this->formats_dropdown( $this->screen->post_type ); |
5 | 578 |
|
579 |
/** |
|
580 |
* Fires before the Filter button on the Posts and Pages list tables. |
|
581 |
* |
|
582 |
* The Filter button allows sorting by date and/or category on the |
|
583 |
* Posts list table, and sorting by date on the Pages list table. |
|
584 |
* |
|
585 |
* @since 2.1.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
586 |
* @since 4.4.0 The `$post_type` parameter was added. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
587 |
* @since 4.6.0 The `$which` parameter was added. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
588 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
589 |
* @param string $post_type The post type slug. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
590 |
* @param string $which The location of the extra table nav markup: |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
591 |
* 'top' or 'bottom' for WP_Posts_List_Table, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
592 |
* 'bar' for WP_Media_List_Table. |
5 | 593 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
594 |
do_action( 'restrict_manage_posts', $this->screen->post_type, $which ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
595 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
596 |
$output = ob_get_clean(); |
5 | 597 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
598 |
if ( ! empty( $output ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
599 |
echo $output; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
600 |
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
601 |
} |
0 | 602 |
} |
603 |
||
18 | 604 |
if ( $this->is_trash && $this->has_items() |
605 |
&& current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) |
|
606 |
) { |
|
0 | 607 |
submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); |
608 |
} |
|
9 | 609 |
?> |
0 | 610 |
</div> |
9 | 611 |
<?php |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
612 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
613 |
* Fires immediately following the closing "actions" div in the tablenav for the posts |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
614 |
* list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
615 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
616 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
617 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
618 |
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
619 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
620 |
do_action( 'manage_posts_extra_tablenav', $which ); |
0 | 621 |
} |
622 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
623 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
624 |
* @return string |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
625 |
*/ |
5 | 626 |
public function current_action() { |
9 | 627 |
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) { |
0 | 628 |
return 'delete_all'; |
9 | 629 |
} |
0 | 630 |
|
631 |
return parent::current_action(); |
|
632 |
} |
|
633 |
||
5 | 634 |
/** |
16 | 635 |
* @global string $mode List table view mode. |
636 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
637 |
* @return array |
5 | 638 |
*/ |
639 |
protected function get_table_classes() { |
|
16 | 640 |
global $mode; |
641 |
||
642 |
$mode_class = esc_attr( 'table-view-' . $mode ); |
|
643 |
||
18 | 644 |
return array( |
645 |
'widefat', |
|
646 |
'fixed', |
|
647 |
'striped', |
|
648 |
$mode_class, |
|
649 |
is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts', |
|
650 |
); |
|
0 | 651 |
} |
652 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
653 |
/** |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
654 |
* @return string[] Array of column titles keyed by their column name. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
655 |
*/ |
5 | 656 |
public function get_columns() { |
0 | 657 |
$post_type = $this->screen->post_type; |
658 |
||
659 |
$posts_columns = array(); |
|
660 |
||
661 |
$posts_columns['cb'] = '<input type="checkbox" />'; |
|
662 |
||
16 | 663 |
/* translators: Posts screen column name. */ |
0 | 664 |
$posts_columns['title'] = _x( 'Title', 'column name' ); |
665 |
||
5 | 666 |
if ( post_type_supports( $post_type, 'author' ) ) { |
0 | 667 |
$posts_columns['author'] = __( 'Author' ); |
5 | 668 |
} |
0 | 669 |
|
670 |
$taxonomies = get_object_taxonomies( $post_type, 'objects' ); |
|
671 |
$taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' ); |
|
672 |
||
5 | 673 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
674 |
* Filters the taxonomy columns in the Posts list table. |
5 | 675 |
* |
676 |
* The dynamic portion of the hook name, `$post_type`, refers to the post |
|
677 |
* type slug. |
|
678 |
* |
|
18 | 679 |
* Possible hook names include: |
680 |
* |
|
681 |
* - `manage_taxonomies_for_post_columns` |
|
682 |
* - `manage_taxonomies_for_page_columns` |
|
683 |
* |
|
5 | 684 |
* @since 3.5.0 |
685 |
* |
|
9 | 686 |
* @param string[] $taxonomies Array of taxonomy names to show columns for. |
687 |
* @param string $post_type The post type. |
|
5 | 688 |
*/ |
0 | 689 |
$taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type ); |
690 |
$taxonomies = array_filter( $taxonomies, 'taxonomy_exists' ); |
|
691 |
||
692 |
foreach ( $taxonomies as $taxonomy ) { |
|
9 | 693 |
if ( 'category' === $taxonomy ) { |
0 | 694 |
$column_key = 'categories'; |
9 | 695 |
} elseif ( 'post_tag' === $taxonomy ) { |
0 | 696 |
$column_key = 'tags'; |
9 | 697 |
} else { |
0 | 698 |
$column_key = 'taxonomy-' . $taxonomy; |
9 | 699 |
} |
0 | 700 |
|
701 |
$posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name; |
|
702 |
} |
|
703 |
||
9 | 704 |
$post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all'; |
18 | 705 |
|
706 |
if ( post_type_supports( $post_type, 'comments' ) |
|
707 |
&& ! in_array( $post_status, array( 'pending', 'draft', 'future' ), true ) |
|
708 |
) { |
|
709 |
$posts_columns['comments'] = sprintf( |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
710 |
'<span class="vers comment-grey-bubble" title="%1$s" aria-hidden="true"></span><span class="screen-reader-text">%2$s</span>', |
18 | 711 |
esc_attr__( 'Comments' ), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
712 |
/* translators: Hidden accessibility text. */ |
18 | 713 |
__( 'Comments' ) |
714 |
); |
|
9 | 715 |
} |
0 | 716 |
|
717 |
$posts_columns['date'] = __( 'Date' ); |
|
718 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
719 |
if ( 'page' === $post_type ) { |
5 | 720 |
|
721 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
722 |
* Filters the columns displayed in the Pages list table. |
5 | 723 |
* |
724 |
* @since 2.5.0 |
|
725 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
726 |
* @param string[] $posts_columns An associative array of column headings. |
5 | 727 |
*/ |
0 | 728 |
$posts_columns = apply_filters( 'manage_pages_columns', $posts_columns ); |
5 | 729 |
} else { |
730 |
||
731 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
732 |
* Filters the columns displayed in the Posts list table. |
5 | 733 |
* |
734 |
* @since 1.5.0 |
|
735 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
736 |
* @param string[] $posts_columns An associative array of column headings. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
737 |
* @param string $post_type The post type slug. |
5 | 738 |
*/ |
0 | 739 |
$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type ); |
5 | 740 |
} |
741 |
||
742 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
743 |
* Filters the columns displayed in the Posts list table for a specific post type. |
5 | 744 |
* |
745 |
* The dynamic portion of the hook name, `$post_type`, refers to the post type slug. |
|
746 |
* |
|
18 | 747 |
* Possible hook names include: |
748 |
* |
|
749 |
* - `manage_post_posts_columns` |
|
750 |
* - `manage_page_posts_columns` |
|
751 |
* |
|
5 | 752 |
* @since 3.0.0 |
753 |
* |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
754 |
* @param string[] $posts_columns An associative array of column headings. |
5 | 755 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
756 |
return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns ); |
0 | 757 |
} |
758 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
759 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
760 |
* @return array |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
761 |
*/ |
5 | 762 |
protected function get_sortable_columns() { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
763 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
764 |
$post_type = $this->screen->post_type; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
765 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
766 |
if ( 'page' === $post_type ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
767 |
if ( isset( $_GET['orderby'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
768 |
$title_orderby_text = __( 'Table ordered by Title.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
769 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
770 |
$title_orderby_text = __( 'Table ordered by Hierarchical Menu Order and Title.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
771 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
772 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
773 |
$sortables = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
774 |
'title' => array( 'title', false, __( 'Title' ), $title_orderby_text, 'asc' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
775 |
'parent' => array( 'parent', false ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
776 |
'comments' => array( 'comment_count', false, __( 'Comments' ), __( 'Table ordered by Comments.' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
777 |
'date' => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
778 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
779 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
780 |
$sortables = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
781 |
'title' => array( 'title', false, __( 'Title' ), __( 'Table ordered by Title.' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
782 |
'parent' => array( 'parent', false ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
783 |
'comments' => array( 'comment_count', false, __( 'Comments' ), __( 'Table ordered by Comments.' ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
784 |
'date' => array( 'date', true, __( 'Date' ), __( 'Table ordered by Date.' ), 'desc' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
785 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
786 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
787 |
// Custom Post Types: there's a filter for that, see get_column_info(). |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
788 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
789 |
return $sortables; |
0 | 790 |
} |
791 |
||
5 | 792 |
/** |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
793 |
* Generates the list table rows. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
794 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
795 |
* @since 3.1.0 |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
796 |
* |
16 | 797 |
* @global WP_Query $wp_query WordPress Query object. |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
798 |
* @global int $per_page |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
799 |
* |
5 | 800 |
* @param array $posts |
16 | 801 |
* @param int $level |
5 | 802 |
*/ |
803 |
public function display_rows( $posts = array(), $level = 0 ) { |
|
0 | 804 |
global $wp_query, $per_page; |
805 |
||
9 | 806 |
if ( empty( $posts ) ) { |
0 | 807 |
$posts = $wp_query->posts; |
9 | 808 |
} |
0 | 809 |
|
810 |
add_filter( 'the_title', 'esc_html' ); |
|
811 |
||
812 |
if ( $this->hierarchical_display ) { |
|
813 |
$this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page ); |
|
814 |
} else { |
|
815 |
$this->_display_rows( $posts, $level ); |
|
816 |
} |
|
817 |
} |
|
818 |
||
5 | 819 |
/** |
820 |
* @param array $posts |
|
16 | 821 |
* @param int $level |
5 | 822 |
*/ |
823 |
private function _display_rows( $posts, $level = 0 ) { |
|
9 | 824 |
$post_type = $this->screen->post_type; |
825 |
||
0 | 826 |
// Create array of post IDs. |
827 |
$post_ids = array(); |
|
828 |
||
9 | 829 |
foreach ( $posts as $a_post ) { |
0 | 830 |
$post_ids[] = $a_post->ID; |
9 | 831 |
} |
0 | 832 |
|
9 | 833 |
if ( post_type_supports( $post_type, 'comments' ) ) { |
834 |
$this->comment_pending_count = get_pending_comments_num( $post_ids ); |
|
835 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
836 |
update_post_author_caches( $posts ); |
0 | 837 |
|
9 | 838 |
foreach ( $posts as $post ) { |
0 | 839 |
$this->single_row( $post, $level ); |
9 | 840 |
} |
0 | 841 |
} |
842 |
||
5 | 843 |
/** |
16 | 844 |
* @global wpdb $wpdb WordPress database abstraction object. |
845 |
* @global WP_Post $post Global post object. |
|
5 | 846 |
* @param array $pages |
16 | 847 |
* @param int $pagenum |
848 |
* @param int $per_page |
|
5 | 849 |
*/ |
850 |
private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) { |
|
0 | 851 |
global $wpdb; |
852 |
||
853 |
$level = 0; |
|
854 |
||
855 |
if ( ! $pages ) { |
|
856 |
$pages = get_pages( array( 'sort_column' => 'menu_order' ) ); |
|
857 |
||
9 | 858 |
if ( ! $pages ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
859 |
return; |
9 | 860 |
} |
0 | 861 |
} |
862 |
||
863 |
/* |
|
19 | 864 |
* Arrange pages into two parts: top level pages and children_pages. |
865 |
* children_pages is two dimensional array. Example: |
|
0 | 866 |
* children_pages[10][] contains all sub-pages whose parent is 10. |
867 |
* It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations |
|
868 |
* If searching, ignore hierarchy and treat everything as top level |
|
869 |
*/ |
|
870 |
if ( empty( $_REQUEST['s'] ) ) { |
|
871 |
$top_level_pages = array(); |
|
9 | 872 |
$children_pages = array(); |
0 | 873 |
|
874 |
foreach ( $pages as $page ) { |
|
5 | 875 |
// Catch and repair bad pages. |
18 | 876 |
if ( $page->post_parent === $page->ID ) { |
0 | 877 |
$page->post_parent = 0; |
878 |
$wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) ); |
|
879 |
clean_post_cache( $page ); |
|
880 |
} |
|
881 |
||
18 | 882 |
if ( $page->post_parent > 0 ) { |
883 |
$children_pages[ $page->post_parent ][] = $page; |
|
884 |
} else { |
|
0 | 885 |
$top_level_pages[] = $page; |
9 | 886 |
} |
0 | 887 |
} |
888 |
||
889 |
$pages = &$top_level_pages; |
|
890 |
} |
|
891 |
||
9 | 892 |
$count = 0; |
893 |
$start = ( $pagenum - 1 ) * $per_page; |
|
894 |
$end = $start + $per_page; |
|
5 | 895 |
$to_display = array(); |
0 | 896 |
|
897 |
foreach ( $pages as $page ) { |
|
9 | 898 |
if ( $count >= $end ) { |
0 | 899 |
break; |
9 | 900 |
} |
0 | 901 |
|
902 |
if ( $count >= $start ) { |
|
9 | 903 |
$to_display[ $page->ID ] = $level; |
0 | 904 |
} |
905 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
906 |
++$count; |
0 | 907 |
|
9 | 908 |
if ( isset( $children_pages ) ) { |
5 | 909 |
$this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); |
9 | 910 |
} |
0 | 911 |
} |
912 |
||
5 | 913 |
// If it is the last pagenum and there are orphaned pages, display them with paging as well. |
9 | 914 |
if ( isset( $children_pages ) && $count < $end ) { |
915 |
foreach ( $children_pages as $orphans ) { |
|
0 | 916 |
foreach ( $orphans as $op ) { |
9 | 917 |
if ( $count >= $end ) { |
0 | 918 |
break; |
9 | 919 |
} |
0 | 920 |
|
921 |
if ( $count >= $start ) { |
|
9 | 922 |
$to_display[ $op->ID ] = 0; |
0 | 923 |
} |
924 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
925 |
++$count; |
0 | 926 |
} |
927 |
} |
|
928 |
} |
|
5 | 929 |
|
930 |
$ids = array_keys( $to_display ); |
|
931 |
_prime_post_caches( $ids ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
932 |
$_posts = array_map( 'get_post', $ids ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
933 |
update_post_author_caches( $_posts ); |
5 | 934 |
|
935 |
if ( ! isset( $GLOBALS['post'] ) ) { |
|
936 |
$GLOBALS['post'] = reset( $ids ); |
|
937 |
} |
|
938 |
||
939 |
foreach ( $to_display as $page_id => $level ) { |
|
940 |
echo "\t"; |
|
941 |
$this->single_row( $page_id, $level ); |
|
942 |
} |
|
0 | 943 |
} |
944 |
||
945 |
/** |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
946 |
* Displays the nested hierarchy of sub-pages together with paging |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
947 |
* support, based on a top level page ID. |
0 | 948 |
* |
949 |
* @since 3.1.0 (Standalone function exists since 2.6.0) |
|
5 | 950 |
* @since 4.2.0 Added the `$to_display` parameter. |
0 | 951 |
* |
952 |
* @param array $children_pages |
|
16 | 953 |
* @param int $count |
19 | 954 |
* @param int $parent_page |
16 | 955 |
* @param int $level |
956 |
* @param int $pagenum |
|
957 |
* @param int $per_page |
|
5 | 958 |
* @param array $to_display List of pages to be displayed. Passed by reference. |
0 | 959 |
*/ |
19 | 960 |
private function _page_rows( &$children_pages, &$count, $parent_page, $level, $pagenum, $per_page, &$to_display ) { |
961 |
if ( ! isset( $children_pages[ $parent_page ] ) ) { |
|
0 | 962 |
return; |
9 | 963 |
} |
0 | 964 |
|
965 |
$start = ( $pagenum - 1 ) * $per_page; |
|
9 | 966 |
$end = $start + $per_page; |
0 | 967 |
|
19 | 968 |
foreach ( $children_pages[ $parent_page ] as $page ) { |
9 | 969 |
if ( $count >= $end ) { |
0 | 970 |
break; |
9 | 971 |
} |
0 | 972 |
|
973 |
// If the page starts in a subtree, print the parents. |
|
18 | 974 |
if ( $count === $start && $page->post_parent > 0 ) { |
0 | 975 |
$my_parents = array(); |
9 | 976 |
$my_parent = $page->post_parent; |
18 | 977 |
|
0 | 978 |
while ( $my_parent ) { |
16 | 979 |
// Get the ID from the list or the attribute if my_parent is an object. |
5 | 980 |
$parent_id = $my_parent; |
18 | 981 |
|
5 | 982 |
if ( is_object( $my_parent ) ) { |
983 |
$parent_id = $my_parent->ID; |
|
984 |
} |
|
985 |
||
9 | 986 |
$my_parent = get_post( $parent_id ); |
0 | 987 |
$my_parents[] = $my_parent; |
18 | 988 |
|
9 | 989 |
if ( ! $my_parent->post_parent ) { |
0 | 990 |
break; |
9 | 991 |
} |
18 | 992 |
|
0 | 993 |
$my_parent = $my_parent->post_parent; |
994 |
} |
|
18 | 995 |
|
0 | 996 |
$num_parents = count( $my_parents ); |
18 | 997 |
|
0 | 998 |
while ( $my_parent = array_pop( $my_parents ) ) { |
9 | 999 |
$to_display[ $my_parent->ID ] = $level - $num_parents; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1000 |
--$num_parents; |
0 | 1001 |
} |
1002 |
} |
|
1003 |
||
1004 |
if ( $count >= $start ) { |
|
9 | 1005 |
$to_display[ $page->ID ] = $level; |
0 | 1006 |
} |
1007 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1008 |
++$count; |
0 | 1009 |
|
5 | 1010 |
$this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); |
0 | 1011 |
} |
1012 |
||
19 | 1013 |
unset( $children_pages[ $parent_page ] ); // Required in order to keep track of orphans. |
0 | 1014 |
} |
1015 |
||
5 | 1016 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1017 |
* Handles the checkbox column output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1018 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1019 |
* @since 4.3.0 |
19 | 1020 |
* @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1021 |
* |
19 | 1022 |
* @param WP_Post $item The current WP_Post object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1023 |
*/ |
19 | 1024 |
public function column_cb( $item ) { |
1025 |
// Restores the more descriptive, specific name for use within this method. |
|
1026 |
$post = $item; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1027 |
|
18 | 1028 |
$show = current_user_can( 'edit_post', $post->ID ); |
1029 |
||
1030 |
/** |
|
1031 |
* Filters whether to show the bulk edit checkbox for a post in its list table. |
|
1032 |
* |
|
1033 |
* By default the checkbox is only shown if the current user can edit the post. |
|
1034 |
* |
|
1035 |
* @since 5.7.0 |
|
1036 |
* |
|
1037 |
* @param bool $show Whether to show the checkbox. |
|
1038 |
* @param WP_Post $post The current WP_Post object. |
|
1039 |
*/ |
|
1040 |
if ( apply_filters( 'wp_list_table_show_post_checkbox', $show, $post ) ) : |
|
9 | 1041 |
?> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1042 |
<input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1043 |
<label for="cb-select-<?php the_ID(); ?>"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1044 |
<span class="screen-reader-text"> |
16 | 1045 |
<?php |
1046 |
/* translators: %s: Post title. */ |
|
1047 |
printf( __( 'Select %s' ), _draft_or_post_title() ); |
|
1048 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1049 |
</span> |
9 | 1050 |
</label> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1051 |
<div class="locked-indicator"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1052 |
<span class="locked-indicator-icon" aria-hidden="true"></span> |
9 | 1053 |
<span class="screen-reader-text"> |
1054 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1055 |
printf( |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1056 |
/* translators: Hidden accessibility text. %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1057 |
__( '“%s” is locked' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1058 |
_draft_or_post_title() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1059 |
); |
9 | 1060 |
?> |
1061 |
</span> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1062 |
</div> |
9 | 1063 |
<?php |
1064 |
endif; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1065 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1066 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1067 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1068 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1069 |
* |
5 | 1070 |
* @param WP_Post $post |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1071 |
* @param string $classes |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1072 |
* @param string $data |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1073 |
* @param string $primary |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1074 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1075 |
protected function _column_title( $post, $classes, $data, $primary ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1076 |
echo '<td class="' . $classes . ' page-title" ', $data, '>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1077 |
echo $this->column_title( $post ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1078 |
echo $this->handle_row_actions( $post, 'title', $primary ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1079 |
echo '</td>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1080 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1081 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1082 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1083 |
* Handles the title column output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1084 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1085 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1086 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1087 |
* @global string $mode List table view mode. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1088 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1089 |
* @param WP_Post $post The current WP_Post object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1090 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1091 |
public function column_title( $post ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1092 |
global $mode; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1093 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1094 |
if ( $this->hierarchical_display ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1095 |
if ( 0 === $this->current_level && (int) $post->post_parent > 0 ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1096 |
// Sent level 0 by accident, by default, or because we don't know the actual level. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1097 |
$find_main_page = (int) $post->post_parent; |
18 | 1098 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1099 |
while ( $find_main_page > 0 ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1100 |
$parent = get_post( $find_main_page ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1101 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1102 |
if ( is_null( $parent ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1103 |
break; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1104 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1105 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1106 |
++$this->current_level; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1107 |
$find_main_page = (int) $parent->post_parent; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1108 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1109 |
if ( ! isset( $parent_name ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1110 |
/** This filter is documented in wp-includes/post-template.php */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1111 |
$parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1112 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1113 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1114 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1115 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1116 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1117 |
$can_edit_post = current_user_can( 'edit_post', $post->ID ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1118 |
|
16 | 1119 |
if ( $can_edit_post && 'trash' !== $post->post_status ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1120 |
$lock_holder = wp_check_post_lock( $post->ID ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1121 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1122 |
if ( $lock_holder ) { |
9 | 1123 |
$lock_holder = get_userdata( $lock_holder ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1124 |
$locked_avatar = get_avatar( $lock_holder->ID, 18 ); |
16 | 1125 |
/* translators: %s: User's display name. */ |
1126 |
$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1127 |
} else { |
16 | 1128 |
$locked_avatar = ''; |
1129 |
$locked_text = ''; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1130 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1131 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1132 |
echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1133 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1134 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1135 |
$pad = str_repeat( '— ', $this->current_level ); |
9 | 1136 |
echo '<strong>'; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1137 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1138 |
$title = _draft_or_post_title(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1139 |
|
16 | 1140 |
if ( $can_edit_post && 'trash' !== $post->post_status ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1141 |
printf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1142 |
'<a class="row-title" href="%s" aria-label="%s">%s%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1143 |
get_edit_post_link( $post->ID ), |
16 | 1144 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1145 |
esc_attr( sprintf( __( '“%s” (Edit)' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1146 |
$pad, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1147 |
$title |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1148 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1149 |
} else { |
9 | 1150 |
printf( |
1151 |
'<span>%s%s</span>', |
|
1152 |
$pad, |
|
1153 |
$title |
|
1154 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1155 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1156 |
_post_states( $post ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1157 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1158 |
if ( isset( $parent_name ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1159 |
$post_type_object = get_post_type_object( $post->post_type ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1160 |
echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1161 |
} |
18 | 1162 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1163 |
echo "</strong>\n"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1164 |
|
16 | 1165 |
if ( 'excerpt' === $mode |
1166 |
&& ! is_post_type_hierarchical( $this->screen->post_type ) |
|
1167 |
&& current_user_can( 'read_post', $post->ID ) |
|
1168 |
) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1169 |
if ( post_password_required( $post ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1170 |
echo '<span class="protected-post-excerpt">' . esc_html( get_the_excerpt() ) . '</span>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1171 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1172 |
echo esc_html( get_the_excerpt() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1173 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1174 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1175 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1176 |
/** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1177 |
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1178 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1179 |
if ( $quick_edit_enabled ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1180 |
get_inline_data( $post ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1181 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1182 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1183 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1184 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1185 |
* Handles the post date column output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1186 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1187 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1188 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1189 |
* @global string $mode List table view mode. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1190 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1191 |
* @param WP_Post $post The current WP_Post object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1192 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1193 |
public function column_date( $post ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1194 |
global $mode; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1195 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1196 |
if ( '0000-00-00 00:00:00' === $post->post_date ) { |
16 | 1197 |
$t_time = __( 'Unpublished' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1198 |
$time_diff = 0; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1199 |
} else { |
16 | 1200 |
$t_time = sprintf( |
1201 |
/* translators: 1: Post date, 2: Post time. */ |
|
1202 |
__( '%1$s at %2$s' ), |
|
18 | 1203 |
/* translators: Post date format. See https://www.php.net/manual/datetime.format.php */ |
16 | 1204 |
get_the_time( __( 'Y/m/d' ), $post ), |
18 | 1205 |
/* translators: Post time format. See https://www.php.net/manual/datetime.format.php */ |
16 | 1206 |
get_the_time( __( 'g:i a' ), $post ) |
1207 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1208 |
|
16 | 1209 |
$time = get_post_timestamp( $post ); |
1210 |
$time_diff = time() - $time; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1211 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1212 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1213 |
if ( 'publish' === $post->post_status ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1214 |
$status = __( 'Published' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1215 |
} elseif ( 'future' === $post->post_status ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1216 |
if ( $time_diff > 0 ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1217 |
$status = '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1218 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1219 |
$status = __( 'Scheduled' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1220 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1221 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1222 |
$status = __( 'Last Modified' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1223 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1224 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1225 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1226 |
* Filters the status text of the post. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1227 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1228 |
* @since 4.8.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1229 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1230 |
* @param string $status The status text. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1231 |
* @param WP_Post $post Post object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1232 |
* @param string $column_name The column name. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1233 |
* @param string $mode The list display mode ('excerpt' or 'list'). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1234 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1235 |
$status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1236 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1237 |
if ( $status ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1238 |
echo $status . '<br />'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1239 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1240 |
|
16 | 1241 |
/** |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1242 |
* Filters the published, scheduled, or unpublished time of the post. |
16 | 1243 |
* |
1244 |
* @since 2.5.1 |
|
1245 |
* @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes. |
|
1246 |
* The published time and date are both displayed now, |
|
1247 |
* which is equivalent to the previous 'excerpt' mode. |
|
1248 |
* |
|
1249 |
* @param string $t_time The published time. |
|
1250 |
* @param WP_Post $post Post object. |
|
1251 |
* @param string $column_name The column name. |
|
1252 |
* @param string $mode The list display mode ('excerpt' or 'list'). |
|
1253 |
*/ |
|
1254 |
echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1255 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1256 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1257 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1258 |
* Handles the comments column output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1259 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1260 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1261 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1262 |
* @param WP_Post $post The current WP_Post object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1263 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1264 |
public function column_comments( $post ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1265 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1266 |
<div class="post-com-count-wrapper"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1267 |
<?php |
9 | 1268 |
$pending_comments = isset( $this->comment_pending_count[ $post->ID ] ) ? $this->comment_pending_count[ $post->ID ] : 0; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1269 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1270 |
$this->comments_bubble( $post->ID, $pending_comments ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1271 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1272 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1273 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1274 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1275 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1276 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1277 |
* Handles the post author column output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1278 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1279 |
* @since 4.3.0 |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1280 |
* @since 6.8.0 Added fallback text when author's name is unknown. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1281 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1282 |
* @param WP_Post $post The current WP_Post object. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1283 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1284 |
public function column_author( $post ) { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1285 |
$author = get_the_author(); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1286 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1287 |
if ( ! empty( $author ) ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1288 |
$args = array( |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1289 |
'post_type' => $post->post_type, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1290 |
'author' => get_the_author_meta( 'ID' ), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1291 |
); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1292 |
echo $this->get_edit_link( $args, esc_html( $author ) ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1293 |
} else { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1294 |
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . __( '(no author)' ) . '</span>'; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1295 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1296 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1297 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1298 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1299 |
* Handles the default column output. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1300 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1301 |
* @since 4.3.0 |
19 | 1302 |
* @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1303 |
* |
19 | 1304 |
* @param WP_Post $item The current WP_Post object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1305 |
* @param string $column_name The current column name. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1306 |
*/ |
19 | 1307 |
public function column_default( $item, $column_name ) { |
1308 |
// Restores the more descriptive, specific name for use within this method. |
|
1309 |
$post = $item; |
|
1310 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1311 |
if ( 'categories' === $column_name ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1312 |
$taxonomy = 'category'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1313 |
} elseif ( 'tags' === $column_name ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1314 |
$taxonomy = 'post_tag'; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1315 |
} elseif ( str_starts_with( $column_name, 'taxonomy-' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1316 |
$taxonomy = substr( $column_name, 9 ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1317 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1318 |
$taxonomy = false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1319 |
} |
18 | 1320 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1321 |
if ( $taxonomy ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1322 |
$taxonomy_object = get_taxonomy( $taxonomy ); |
9 | 1323 |
$terms = get_the_terms( $post->ID, $taxonomy ); |
18 | 1324 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1325 |
if ( is_array( $terms ) ) { |
9 | 1326 |
$term_links = array(); |
18 | 1327 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1328 |
foreach ( $terms as $t ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1329 |
$posts_in_term_qv = array(); |
18 | 1330 |
|
16 | 1331 |
if ( 'post' !== $post->post_type ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1332 |
$posts_in_term_qv['post_type'] = $post->post_type; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1333 |
} |
18 | 1334 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1335 |
if ( $taxonomy_object->query_var ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1336 |
$posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1337 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1338 |
$posts_in_term_qv['taxonomy'] = $taxonomy; |
9 | 1339 |
$posts_in_term_qv['term'] = $t->slug; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1340 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1341 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1342 |
$label = esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) ); |
9 | 1343 |
|
1344 |
$term_links[] = $this->get_edit_link( $posts_in_term_qv, $label ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1345 |
} |
9 | 1346 |
|
1347 |
/** |
|
1348 |
* Filters the links in `$taxonomy` column of edit.php. |
|
1349 |
* |
|
1350 |
* @since 5.2.0 |
|
1351 |
* |
|
16 | 1352 |
* @param string[] $term_links Array of term editing links. |
1353 |
* @param string $taxonomy Taxonomy name. |
|
1354 |
* @param WP_Term[] $terms Array of term objects appearing in the post row. |
|
9 | 1355 |
*/ |
1356 |
$term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms ); |
|
1357 |
||
19 | 1358 |
echo implode( wp_get_list_item_separator(), $term_links ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1359 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1360 |
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1361 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1362 |
return; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1363 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1364 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1365 |
if ( is_post_type_hierarchical( $post->post_type ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1366 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1367 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1368 |
* Fires in each custom column on the Posts list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1369 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1370 |
* This hook only fires if the current post type is hierarchical, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1371 |
* such as pages. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1372 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1373 |
* @since 2.5.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1374 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1375 |
* @param string $column_name The name of the column to display. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1376 |
* @param int $post_id The current post ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1377 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1378 |
do_action( 'manage_pages_custom_column', $column_name, $post->ID ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1379 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1380 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1381 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1382 |
* Fires in each custom column in the Posts list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1383 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1384 |
* This hook only fires if the current post type is non-hierarchical, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1385 |
* such as posts. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1386 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1387 |
* @since 1.5.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1388 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1389 |
* @param string $column_name The name of the column to display. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1390 |
* @param int $post_id The current post ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1391 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1392 |
do_action( 'manage_posts_custom_column', $column_name, $post->ID ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1393 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1394 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1395 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1396 |
* Fires for each custom column of a specific post type in the Posts list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1397 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1398 |
* The dynamic portion of the hook name, `$post->post_type`, refers to the post type. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1399 |
* |
18 | 1400 |
* Possible hook names include: |
1401 |
* |
|
1402 |
* - `manage_post_posts_custom_column` |
|
1403 |
* - `manage_page_posts_custom_column` |
|
1404 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1405 |
* @since 3.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1406 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1407 |
* @param string $column_name The name of the column to display. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1408 |
* @param int $post_id The current post ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1409 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1410 |
do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1411 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1412 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1413 |
/** |
16 | 1414 |
* @global WP_Post $post Global post object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1415 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1416 |
* @param int|WP_Post $post |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1417 |
* @param int $level |
5 | 1418 |
*/ |
1419 |
public function single_row( $post, $level = 0 ) { |
|
0 | 1420 |
$global_post = get_post(); |
5 | 1421 |
|
9 | 1422 |
$post = get_post( $post ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1423 |
$this->current_level = $level; |
5 | 1424 |
|
0 | 1425 |
$GLOBALS['post'] = $post; |
1426 |
setup_postdata( $post ); |
|
1427 |
||
18 | 1428 |
$classes = 'iedit author-' . ( get_current_user_id() === (int) $post->post_author ? 'self' : 'other' ); |
0 | 1429 |
|
1430 |
$lock_holder = wp_check_post_lock( $post->ID ); |
|
18 | 1431 |
|
0 | 1432 |
if ( $lock_holder ) { |
1433 |
$classes .= ' wp-locked'; |
|
1434 |
} |
|
5 | 1435 |
|
1436 |
if ( $post->post_parent ) { |
|
9 | 1437 |
$count = count( get_post_ancestors( $post->ID ) ); |
1438 |
$classes .= ' level-' . $count; |
|
5 | 1439 |
} else { |
9 | 1440 |
$classes .= ' level-0'; |
5 | 1441 |
} |
9 | 1442 |
?> |
5 | 1443 |
<tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1444 |
<?php $this->single_row_columns( $post ); ?> |
0 | 1445 |
</tr> |
9 | 1446 |
<?php |
0 | 1447 |
$GLOBALS['post'] = $global_post; |
1448 |
} |
|
1449 |
||
1450 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1451 |
* Gets the name of the default primary column. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1452 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1453 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1454 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1455 |
* @return string Name of the default primary column, in this case, 'title'. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1456 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1457 |
protected function get_default_primary_column_name() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1458 |
return 'title'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1459 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1460 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1461 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1462 |
* Generates and displays row action links. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1463 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1464 |
* @since 4.3.0 |
19 | 1465 |
* @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1466 |
* |
19 | 1467 |
* @param WP_Post $item Post being acted upon. |
18 | 1468 |
* @param string $column_name Current column name. |
1469 |
* @param string $primary Primary column name. |
|
16 | 1470 |
* @return string Row actions output for posts, or an empty string |
1471 |
* if the current column is not the primary column. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1472 |
*/ |
19 | 1473 |
protected function handle_row_actions( $item, $column_name, $primary ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1474 |
if ( $primary !== $column_name ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1475 |
return ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1476 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1477 |
|
19 | 1478 |
// Restores the more descriptive, specific name for use within this method. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1479 |
$post = $item; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1480 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1481 |
$post_type_object = get_post_type_object( $post->post_type ); |
9 | 1482 |
$can_edit_post = current_user_can( 'edit_post', $post->ID ); |
1483 |
$actions = array(); |
|
1484 |
$title = _draft_or_post_title(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1485 |
|
16 | 1486 |
if ( $can_edit_post && 'trash' !== $post->post_status ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1487 |
$actions['edit'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1488 |
'<a href="%s" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1489 |
get_edit_post_link( $post->ID ), |
16 | 1490 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1491 |
esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1492 |
__( 'Edit' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1493 |
); |
9 | 1494 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1495 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1496 |
* Filters whether Quick Edit should be enabled for the given post type. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1497 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1498 |
* @since 6.4.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1499 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1500 |
* @param bool $enable Whether to enable the Quick Edit functionality. Default true. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1501 |
* @param string $post_type Post type name. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1502 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1503 |
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1504 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1505 |
if ( $quick_edit_enabled && 'wp_block' !== $post->post_type ) { |
9 | 1506 |
$actions['inline hide-if-no-js'] = sprintf( |
1507 |
'<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>', |
|
16 | 1508 |
/* translators: %s: Post title. */ |
9 | 1509 |
esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $title ) ), |
1510 |
__( 'Quick Edit' ) |
|
1511 |
); |
|
1512 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1513 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1514 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1515 |
if ( current_user_can( 'delete_post', $post->ID ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1516 |
if ( 'trash' === $post->post_status ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1517 |
$actions['untrash'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1518 |
'<a href="%s" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1519 |
wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ), |
16 | 1520 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1521 |
esc_attr( sprintf( __( 'Restore “%s” from the Trash' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1522 |
__( 'Restore' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1523 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1524 |
} elseif ( EMPTY_TRASH_DAYS ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1525 |
$actions['trash'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1526 |
'<a href="%s" class="submitdelete" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1527 |
get_delete_post_link( $post->ID ), |
16 | 1528 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1529 |
esc_attr( sprintf( __( 'Move “%s” to the Trash' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1530 |
_x( 'Trash', 'verb' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1531 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1532 |
} |
18 | 1533 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1534 |
if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1535 |
$actions['delete'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1536 |
'<a href="%s" class="submitdelete" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1537 |
get_delete_post_link( $post->ID, '', true ), |
16 | 1538 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1539 |
esc_attr( sprintf( __( 'Delete “%s” permanently' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1540 |
__( 'Delete Permanently' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1541 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1542 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1543 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1544 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1545 |
if ( is_post_type_viewable( $post_type_object ) ) { |
16 | 1546 |
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ), true ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1547 |
if ( $can_edit_post ) { |
9 | 1548 |
$preview_link = get_preview_post_link( $post ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1549 |
$actions['view'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1550 |
'<a href="%s" rel="bookmark" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1551 |
esc_url( $preview_link ), |
16 | 1552 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1553 |
esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1554 |
__( 'Preview' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1555 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1556 |
} |
16 | 1557 |
} elseif ( 'trash' !== $post->post_status ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1558 |
$actions['view'] = sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1559 |
'<a href="%s" rel="bookmark" aria-label="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1560 |
get_permalink( $post->ID ), |
16 | 1561 |
/* translators: %s: Post title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1562 |
esc_attr( sprintf( __( 'View “%s”' ), $title ) ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1563 |
__( 'View' ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1564 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1565 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1566 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1567 |
|
9 | 1568 |
if ( 'wp_block' === $post->post_type ) { |
1569 |
$actions['export'] = sprintf( |
|
1570 |
'<button type="button" class="wp-list-reusable-blocks__export button-link" data-id="%s" aria-label="%s">%s</button>', |
|
1571 |
$post->ID, |
|
16 | 1572 |
/* translators: %s: Post title. */ |
9 | 1573 |
esc_attr( sprintf( __( 'Export “%s” as JSON' ), $title ) ), |
1574 |
__( 'Export as JSON' ) |
|
1575 |
); |
|
1576 |
} |
|
1577 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1578 |
if ( is_post_type_hierarchical( $post->post_type ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1579 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1580 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1581 |
* Filters the array of row action links on the Pages list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1582 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1583 |
* The filter is evaluated only for hierarchical post types. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1584 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1585 |
* @since 2.8.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1586 |
* |
9 | 1587 |
* @param string[] $actions An array of row action links. Defaults are |
1588 |
* 'Edit', 'Quick Edit', 'Restore', 'Trash', |
|
1589 |
* 'Delete Permanently', 'Preview', and 'View'. |
|
1590 |
* @param WP_Post $post The post object. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1591 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1592 |
$actions = apply_filters( 'page_row_actions', $actions, $post ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1593 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1594 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1595 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1596 |
* Filters the array of row action links on the Posts list table. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1597 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1598 |
* The filter is evaluated only for non-hierarchical post types. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1599 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1600 |
* @since 2.8.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1601 |
* |
9 | 1602 |
* @param string[] $actions An array of row action links. Defaults are |
1603 |
* 'Edit', 'Quick Edit', 'Restore', 'Trash', |
|
1604 |
* 'Delete Permanently', 'Preview', and 'View'. |
|
1605 |
* @param WP_Post $post The post object. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1606 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1607 |
$actions = apply_filters( 'post_row_actions', $actions, $post ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1608 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1609 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1610 |
return $this->row_actions( $actions ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1611 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1612 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1613 |
/** |
0 | 1614 |
* Outputs the hidden row displayed when inline editing |
1615 |
* |
|
1616 |
* @since 3.1.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1617 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1618 |
* @global string $mode List table view mode. |
0 | 1619 |
*/ |
5 | 1620 |
public function inline_edit() { |
0 | 1621 |
global $mode; |
1622 |
||
1623 |
$screen = $this->screen; |
|
1624 |
||
9 | 1625 |
$post = get_default_post_to_edit( $screen->post_type ); |
0 | 1626 |
$post_type_object = get_post_type_object( $screen->post_type ); |
1627 |
||
9 | 1628 |
$taxonomy_names = get_object_taxonomies( $screen->post_type ); |
0 | 1629 |
$hierarchical_taxonomies = array(); |
9 | 1630 |
$flat_taxonomies = array(); |
16 | 1631 |
|
0 | 1632 |
foreach ( $taxonomy_names as $taxonomy_name ) { |
1633 |
$taxonomy = get_taxonomy( $taxonomy_name ); |
|
1634 |
||
5 | 1635 |
$show_in_quick_edit = $taxonomy->show_in_quick_edit; |
1636 |
||
1637 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1638 |
* Filters whether the current taxonomy should be shown in the Quick Edit panel. |
5 | 1639 |
* |
1640 |
* @since 4.2.0 |
|
1641 |
* |
|
1642 |
* @param bool $show_in_quick_edit Whether to show the current taxonomy in Quick Edit. |
|
1643 |
* @param string $taxonomy_name Taxonomy name. |
|
1644 |
* @param string $post_type Post type of current Quick Edit post. |
|
1645 |
*/ |
|
1646 |
if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) { |
|
0 | 1647 |
continue; |
5 | 1648 |
} |
0 | 1649 |
|
9 | 1650 |
if ( $taxonomy->hierarchical ) { |
0 | 1651 |
$hierarchical_taxonomies[] = $taxonomy; |
9 | 1652 |
} else { |
0 | 1653 |
$flat_taxonomies[] = $taxonomy; |
9 | 1654 |
} |
0 | 1655 |
} |
1656 |
||
9 | 1657 |
$m = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list'; |
1658 |
$can_publish = current_user_can( $post_type_object->cap->publish_posts ); |
|
1659 |
$core_columns = array( |
|
1660 |
'cb' => true, |
|
1661 |
'date' => true, |
|
1662 |
'title' => true, |
|
1663 |
'categories' => true, |
|
1664 |
'tags' => true, |
|
1665 |
'comments' => true, |
|
1666 |
'author' => true, |
|
1667 |
); |
|
1668 |
?> |
|
0 | 1669 |
|
16 | 1670 |
<form method="get"> |
1671 |
<table style="display: none"><tbody id="inlineedit"> |
|
0 | 1672 |
<?php |
9 | 1673 |
$hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page'; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1674 |
$inline_edit_classes = "inline-edit-row inline-edit-row-$hclass"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1675 |
$bulk_edit_classes = "bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1676 |
$quick_edit_classes = "quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1677 |
|
0 | 1678 |
$bulk = 0; |
18 | 1679 |
|
16 | 1680 |
while ( $bulk < 2 ) : |
1681 |
$classes = $inline_edit_classes . ' '; |
|
1682 |
$classes .= $bulk ? $bulk_edit_classes : $quick_edit_classes; |
|
9 | 1683 |
?> |
16 | 1684 |
<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="<?php echo $classes; ?>" style="display: none"> |
1685 |
<td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange"> |
|
19 | 1686 |
<div class="inline-edit-wrapper" role="region" aria-labelledby="<?php echo $bulk ? 'bulk' : 'quick'; ?>-edit-legend"> |
16 | 1687 |
<fieldset class="inline-edit-col-left"> |
19 | 1688 |
<legend class="inline-edit-legend" id="<?php echo $bulk ? 'bulk' : 'quick'; ?>-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend> |
16 | 1689 |
<div class="inline-edit-col"> |
1690 |
||
1691 |
<?php if ( post_type_supports( $screen->post_type, 'title' ) ) : ?> |
|
1692 |
||
1693 |
<?php if ( $bulk ) : ?> |
|
1694 |
||
1695 |
<div id="bulk-title-div"> |
|
1696 |
<div id="bulk-titles"></div> |
|
1697 |
</div> |
|
1698 |
||
1699 |
<?php else : // $bulk ?> |
|
1700 |
||
1701 |
<label> |
|
1702 |
<span class="title"><?php _e( 'Title' ); ?></span> |
|
1703 |
<span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span> |
|
1704 |
</label> |
|
1705 |
||
1706 |
<?php if ( is_post_type_viewable( $screen->post_type ) ) : ?> |
|
1707 |
||
1708 |
<label> |
|
1709 |
<span class="title"><?php _e( 'Slug' ); ?></span> |
|
19 | 1710 |
<span class="input-text-wrap"><input type="text" name="post_name" value="" autocomplete="off" spellcheck="false" /></span> |
16 | 1711 |
</label> |
1712 |
||
1713 |
<?php endif; // is_post_type_viewable() ?> |
|
1714 |
||
1715 |
<?php endif; // $bulk ?> |
|
0 | 1716 |
|
16 | 1717 |
<?php endif; // post_type_supports( ... 'title' ) ?> |
1718 |
||
1719 |
<?php if ( ! $bulk ) : ?> |
|
1720 |
<fieldset class="inline-edit-date"> |
|
1721 |
<legend><span class="title"><?php _e( 'Date' ); ?></span></legend> |
|
1722 |
<?php touch_time( 1, 1, 0, 1 ); ?> |
|
1723 |
</fieldset> |
|
1724 |
<br class="clear" /> |
|
1725 |
<?php endif; // $bulk ?> |
|
1726 |
||
1727 |
<?php |
|
18 | 1728 |
if ( post_type_supports( $screen->post_type, 'author' ) ) { |
16 | 1729 |
$authors_dropdown = ''; |
0 | 1730 |
|
18 | 1731 |
if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) { |
19 | 1732 |
$dropdown_name = 'post_author'; |
1733 |
$dropdown_class = 'authors'; |
|
1734 |
if ( wp_is_large_user_count() ) { |
|
1735 |
$authors_dropdown = sprintf( '<select name="%s" class="%s hidden"></select>', esc_attr( $dropdown_name ), esc_attr( $dropdown_class ) ); |
|
1736 |
} else { |
|
1737 |
$users_opt = array( |
|
1738 |
'hide_if_only_one_author' => false, |
|
1739 |
'capability' => array( $post_type_object->cap->edit_posts ), |
|
1740 |
'name' => $dropdown_name, |
|
1741 |
'class' => $dropdown_class, |
|
1742 |
'multi' => 1, |
|
1743 |
'echo' => 0, |
|
1744 |
'show' => 'display_name_with_login', |
|
1745 |
); |
|
0 | 1746 |
|
19 | 1747 |
if ( $bulk ) { |
1748 |
$users_opt['show_option_none'] = __( '— No Change —' ); |
|
1749 |
} |
|
16 | 1750 |
|
19 | 1751 |
/** |
1752 |
* Filters the arguments used to generate the Quick Edit authors drop-down. |
|
1753 |
* |
|
1754 |
* @since 5.6.0 |
|
1755 |
* |
|
1756 |
* @see wp_dropdown_users() |
|
1757 |
* |
|
1758 |
* @param array $users_opt An array of arguments passed to wp_dropdown_users(). |
|
1759 |
* @param bool $bulk A flag to denote if it's a bulk action. |
|
1760 |
*/ |
|
1761 |
$users_opt = apply_filters( 'quick_edit_dropdown_authors_args', $users_opt, $bulk ); |
|
18 | 1762 |
|
19 | 1763 |
$authors = wp_dropdown_users( $users_opt ); |
18 | 1764 |
|
19 | 1765 |
if ( $authors ) { |
1766 |
$authors_dropdown = '<label class="inline-edit-author">'; |
|
1767 |
$authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>'; |
|
1768 |
$authors_dropdown .= $authors; |
|
1769 |
$authors_dropdown .= '</label>'; |
|
1770 |
} |
|
18 | 1771 |
} |
1772 |
} // current_user_can( 'edit_others_posts' ) |
|
0 | 1773 |
|
16 | 1774 |
if ( ! $bulk ) { |
1775 |
echo $authors_dropdown; |
|
9 | 1776 |
} |
18 | 1777 |
} // post_type_supports( ... 'author' ) |
9 | 1778 |
?> |
0 | 1779 |
|
16 | 1780 |
<?php if ( ! $bulk && $can_publish ) : ?> |
0 | 1781 |
|
16 | 1782 |
<div class="inline-edit-group wp-clearfix"> |
1783 |
<label class="alignleft"> |
|
1784 |
<span class="title"><?php _e( 'Password' ); ?></span> |
|
1785 |
<span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span> |
|
1786 |
</label> |
|
0 | 1787 |
|
16 | 1788 |
<span class="alignleft inline-edit-or"> |
1789 |
<?php |
|
1790 |
/* translators: Between password field and private checkbox on post quick edit interface. */ |
|
1791 |
_e( '–OR–' ); |
|
1792 |
?> |
|
1793 |
</span> |
|
1794 |
<label class="alignleft inline-edit-private"> |
|
1795 |
<input type="checkbox" name="keep_private" value="private" /> |
|
1796 |
<span class="checkbox-title"><?php _e( 'Private' ); ?></span> |
|
1797 |
</label> |
|
1798 |
</div> |
|
0 | 1799 |
|
9 | 1800 |
<?php endif; ?> |
0 | 1801 |
|
16 | 1802 |
</div> |
1803 |
</fieldset> |
|
0 | 1804 |
|
9 | 1805 |
<?php if ( count( $hierarchical_taxonomies ) && ! $bulk ) : ?> |
0 | 1806 |
|
16 | 1807 |
<fieldset class="inline-edit-col-center inline-edit-categories"> |
1808 |
<div class="inline-edit-col"> |
|
0 | 1809 |
|
16 | 1810 |
<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?> |
0 | 1811 |
|
16 | 1812 |
<span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span> |
1813 |
<input type="hidden" name="<?php echo ( 'category' === $taxonomy->name ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" /> |
|
1814 |
<ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist"> |
|
19 | 1815 |
<?php wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name ) ); ?> |
16 | 1816 |
</ul> |
0 | 1817 |
|
16 | 1818 |
<?php endforeach; // $hierarchical_taxonomies as $taxonomy ?> |
0 | 1819 |
|
16 | 1820 |
</div> |
1821 |
</fieldset> |
|
0 | 1822 |
|
16 | 1823 |
<?php endif; // count( $hierarchical_taxonomies ) && ! $bulk ?> |
0 | 1824 |
|
16 | 1825 |
<fieldset class="inline-edit-col-right"> |
1826 |
<div class="inline-edit-col"> |
|
0 | 1827 |
|
9 | 1828 |
<?php |
16 | 1829 |
if ( post_type_supports( $screen->post_type, 'author' ) && $bulk ) { |
1830 |
echo $authors_dropdown; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1831 |
} |
9 | 1832 |
?> |
16 | 1833 |
|
1834 |
<?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) : ?> |
|
1835 |
||
1836 |
<?php if ( $post_type_object->hierarchical ) : ?> |
|
1837 |
||
1838 |
<label> |
|
1839 |
<span class="title"><?php _e( 'Parent' ); ?></span> |
|
1840 |
<?php |
|
1841 |
$dropdown_args = array( |
|
1842 |
'post_type' => $post_type_object->name, |
|
1843 |
'selected' => $post->post_parent, |
|
1844 |
'name' => 'post_parent', |
|
1845 |
'show_option_none' => __( 'Main Page (no parent)' ), |
|
1846 |
'option_none_value' => 0, |
|
1847 |
'sort_column' => 'menu_order, post_title', |
|
1848 |
); |
|
1849 |
||
1850 |
if ( $bulk ) { |
|
1851 |
$dropdown_args['show_option_no_change'] = __( '— No Change —' ); |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1852 |
$dropdown_args['id'] = 'bulk_edit_post_parent'; |
16 | 1853 |
} |
1854 |
||
1855 |
/** |
|
1856 |
* Filters the arguments used to generate the Quick Edit page-parent drop-down. |
|
1857 |
* |
|
1858 |
* @since 2.7.0 |
|
18 | 1859 |
* @since 5.6.0 The `$bulk` parameter was added. |
16 | 1860 |
* |
1861 |
* @see wp_dropdown_pages() |
|
1862 |
* |
|
18 | 1863 |
* @param array $dropdown_args An array of arguments passed to wp_dropdown_pages(). |
1864 |
* @param bool $bulk A flag to denote if it's a bulk action. |
|
16 | 1865 |
*/ |
18 | 1866 |
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args, $bulk ); |
16 | 1867 |
|
1868 |
wp_dropdown_pages( $dropdown_args ); |
|
1869 |
?> |
|
1870 |
</label> |
|
1871 |
||
1872 |
<?php endif; // hierarchical ?> |
|
1873 |
||
1874 |
<?php if ( ! $bulk ) : ?> |
|
1875 |
||
1876 |
<label> |
|
1877 |
<span class="title"><?php _e( 'Order' ); ?></span> |
|
1878 |
<span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order; ?>" /></span> |
|
1879 |
</label> |
|
1880 |
||
1881 |
<?php endif; // ! $bulk ?> |
|
1882 |
||
1883 |
<?php endif; // post_type_supports( ... 'page-attributes' ) ?> |
|
1884 |
||
1885 |
<?php if ( 0 < count( get_page_templates( null, $screen->post_type ) ) ) : ?> |
|
1886 |
||
1887 |
<label> |
|
1888 |
<span class="title"><?php _e( 'Template' ); ?></span> |
|
1889 |
<select name="page_template"> |
|
1890 |
<?php if ( $bulk ) : ?> |
|
1891 |
<option value="-1"><?php _e( '— No Change —' ); ?></option> |
|
1892 |
<?php endif; // $bulk ?> |
|
1893 |
<?php |
|
1894 |
/** This filter is documented in wp-admin/includes/meta-boxes.php */ |
|
1895 |
$default_title = apply_filters( 'default_page_template_title', __( 'Default template' ), 'quick-edit' ); |
|
1896 |
?> |
|
1897 |
<option value="default"><?php echo esc_html( $default_title ); ?></option> |
|
1898 |
<?php page_template_dropdown( '', $screen->post_type ); ?> |
|
1899 |
</select> |
|
1900 |
</label> |
|
1901 |
||
1902 |
<?php endif; ?> |
|
1903 |
||
1904 |
<?php if ( count( $flat_taxonomies ) && ! $bulk ) : ?> |
|
1905 |
||
1906 |
<?php foreach ( $flat_taxonomies as $taxonomy ) : ?> |
|
1907 |
||
1908 |
<?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) : ?> |
|
1909 |
<?php $taxonomy_name = esc_attr( $taxonomy->name ); ?> |
|
19 | 1910 |
<div class="inline-edit-tags-wrap"> |
16 | 1911 |
<label class="inline-edit-tags"> |
1912 |
<span class="title"><?php echo esc_html( $taxonomy->labels->name ); ?></span> |
|
19 | 1913 |
<textarea data-wp-taxonomy="<?php echo $taxonomy_name; ?>" cols="22" rows="1" name="tax_input[<?php echo esc_attr( $taxonomy->name ); ?>]" class="tax_input_<?php echo esc_attr( $taxonomy->name ); ?>" aria-describedby="inline-edit-<?php echo esc_attr( $taxonomy->name ); ?>-desc"></textarea> |
16 | 1914 |
</label> |
19 | 1915 |
<p class="howto" id="inline-edit-<?php echo esc_attr( $taxonomy->name ); ?>-desc"><?php echo esc_html( $taxonomy->labels->separate_items_with_commas ); ?></p> |
1916 |
</div> |
|
16 | 1917 |
<?php endif; // current_user_can( 'assign_terms' ) ?> |
1918 |
||
1919 |
<?php endforeach; // $flat_taxonomies as $taxonomy ?> |
|
1920 |
||
1921 |
<?php endif; // count( $flat_taxonomies ) && ! $bulk ?> |
|
1922 |
||
1923 |
<?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?> |
|
1924 |
||
1925 |
<?php if ( $bulk ) : ?> |
|
1926 |
||
1927 |
<div class="inline-edit-group wp-clearfix"> |
|
1928 |
||
1929 |
<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?> |
|
1930 |
||
1931 |
<label class="alignleft"> |
|
1932 |
<span class="title"><?php _e( 'Comments' ); ?></span> |
|
1933 |
<select name="comment_status"> |
|
1934 |
<option value=""><?php _e( '— No Change —' ); ?></option> |
|
1935 |
<option value="open"><?php _e( 'Allow' ); ?></option> |
|
1936 |
<option value="closed"><?php _e( 'Do not allow' ); ?></option> |
|
1937 |
</select> |
|
1938 |
</label> |
|
1939 |
||
1940 |
<?php endif; ?> |
|
1941 |
||
1942 |
<?php if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?> |
|
9 | 1943 |
|
16 | 1944 |
<label class="alignright"> |
1945 |
<span class="title"><?php _e( 'Pings' ); ?></span> |
|
1946 |
<select name="ping_status"> |
|
1947 |
<option value=""><?php _e( '— No Change —' ); ?></option> |
|
1948 |
<option value="open"><?php _e( 'Allow' ); ?></option> |
|
1949 |
<option value="closed"><?php _e( 'Do not allow' ); ?></option> |
|
1950 |
</select> |
|
1951 |
</label> |
|
1952 |
||
1953 |
<?php endif; ?> |
|
1954 |
||
1955 |
</div> |
|
1956 |
||
1957 |
<?php else : // $bulk ?> |
|
1958 |
||
1959 |
<div class="inline-edit-group wp-clearfix"> |
|
1960 |
||
1961 |
<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?> |
|
1962 |
||
1963 |
<label class="alignleft"> |
|
1964 |
<input type="checkbox" name="comment_status" value="open" /> |
|
1965 |
<span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span> |
|
1966 |
</label> |
|
1967 |
||
1968 |
<?php endif; ?> |
|
1969 |
||
1970 |
<?php if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?> |
|
1971 |
||
1972 |
<label class="alignleft"> |
|
1973 |
<input type="checkbox" name="ping_status" value="open" /> |
|
1974 |
<span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span> |
|
1975 |
</label> |
|
1976 |
||
1977 |
<?php endif; ?> |
|
1978 |
||
1979 |
</div> |
|
1980 |
||
1981 |
<?php endif; // $bulk ?> |
|
1982 |
||
1983 |
<?php endif; // post_type_supports( ... comments or pings ) ?> |
|
1984 |
||
1985 |
<div class="inline-edit-group wp-clearfix"> |
|
1986 |
||
1987 |
<label class="inline-edit-status alignleft"> |
|
1988 |
<span class="title"><?php _e( 'Status' ); ?></span> |
|
1989 |
<select name="_status"> |
|
1990 |
<?php if ( $bulk ) : ?> |
|
1991 |
<option value="-1"><?php _e( '— No Change —' ); ?></option> |
|
1992 |
<?php endif; // $bulk ?> |
|
9 | 1993 |
|
16 | 1994 |
<?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review". ?> |
1995 |
<option value="publish"><?php _e( 'Published' ); ?></option> |
|
1996 |
<option value="future"><?php _e( 'Scheduled' ); ?></option> |
|
1997 |
<?php if ( $bulk ) : ?> |
|
1998 |
<option value="private"><?php _e( 'Private' ); ?></option> |
|
1999 |
<?php endif; // $bulk ?> |
|
2000 |
<?php endif; ?> |
|
2001 |
||
2002 |
<option value="pending"><?php _e( 'Pending Review' ); ?></option> |
|
2003 |
<option value="draft"><?php _e( 'Draft' ); ?></option> |
|
2004 |
</select> |
|
2005 |
</label> |
|
2006 |
||
2007 |
<?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?> |
|
2008 |
||
2009 |
<?php if ( $bulk ) : ?> |
|
2010 |
||
2011 |
<label class="alignright"> |
|
2012 |
<span class="title"><?php _e( 'Sticky' ); ?></span> |
|
2013 |
<select name="sticky"> |
|
2014 |
<option value="-1"><?php _e( '— No Change —' ); ?></option> |
|
2015 |
<option value="sticky"><?php _e( 'Sticky' ); ?></option> |
|
2016 |
<option value="unsticky"><?php _e( 'Not Sticky' ); ?></option> |
|
2017 |
</select> |
|
2018 |
</label> |
|
2019 |
||
2020 |
<?php else : // $bulk ?> |
|
0 | 2021 |
|
16 | 2022 |
<label class="alignleft"> |
2023 |
<input type="checkbox" name="sticky" value="sticky" /> |
|
2024 |
<span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span> |
|
2025 |
</label> |
|
2026 |
||
2027 |
<?php endif; // $bulk ?> |
|
2028 |
||
2029 |
<?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_posts' ) ?> |
|
2030 |
||
2031 |
</div> |
|
2032 |
||
2033 |
<?php if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) : ?> |
|
2034 |
<?php $post_formats = get_theme_support( 'post-formats' ); ?> |
|
2035 |
||
2036 |
<label class="alignleft"> |
|
2037 |
<span class="title"><?php _ex( 'Format', 'post format' ); ?></span> |
|
2038 |
<select name="post_format"> |
|
2039 |
<option value="-1"><?php _e( '— No Change —' ); ?></option> |
|
2040 |
<option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> |
|
2041 |
<?php if ( is_array( $post_formats[0] ) ) : ?> |
|
2042 |
<?php foreach ( $post_formats[0] as $format ) : ?> |
|
2043 |
<option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option> |
|
2044 |
<?php endforeach; ?> |
|
2045 |
<?php endif; ?> |
|
2046 |
</select> |
|
2047 |
</label> |
|
2048 |
||
2049 |
<?php endif; ?> |
|
2050 |
||
2051 |
</div> |
|
2052 |
</fieldset> |
|
0 | 2053 |
|
9 | 2054 |
<?php |
2055 |
list( $columns ) = $this->get_column_info(); |
|
0 | 2056 |
|
9 | 2057 |
foreach ( $columns as $column_name => $column_display_name ) { |
2058 |
if ( isset( $core_columns[ $column_name ] ) ) { |
|
2059 |
continue; |
|
2060 |
} |
|
5 | 2061 |
|
9 | 2062 |
if ( $bulk ) { |
5 | 2063 |
|
9 | 2064 |
/** |
2065 |
* Fires once for each column in Bulk Edit mode. |
|
2066 |
* |
|
2067 |
* @since 2.7.0 |
|
2068 |
* |
|
16 | 2069 |
* @param string $column_name Name of the column to edit. |
2070 |
* @param string $post_type The post type slug. |
|
9 | 2071 |
*/ |
2072 |
do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type ); |
|
2073 |
} else { |
|
5 | 2074 |
|
9 | 2075 |
/** |
2076 |
* Fires once for each column in Quick Edit mode. |
|
2077 |
* |
|
2078 |
* @since 2.7.0 |
|
2079 |
* |
|
2080 |
* @param string $column_name Name of the column to edit. |
|
2081 |
* @param string $post_type The post type slug, or current screen name if this is a taxonomy list table. |
|
16 | 2082 |
* @param string $taxonomy The taxonomy name, if any. |
9 | 2083 |
*/ |
2084 |
do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' ); |
|
2085 |
} |
|
5 | 2086 |
} |
9 | 2087 |
?> |
16 | 2088 |
|
2089 |
<div class="submit inline-edit-save"> |
|
2090 |
<?php if ( ! $bulk ) : ?> |
|
2091 |
<?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?> |
|
19 | 2092 |
<button type="button" class="button button-primary save"><?php _e( 'Update' ); ?></button> |
2093 |
<?php else : ?> |
|
2094 |
<?php submit_button( __( 'Update' ), 'primary', 'bulk_edit', false ); ?> |
|
2095 |
<?php endif; ?> |
|
2096 |
||
2097 |
<button type="button" class="button cancel"><?php _e( 'Cancel' ); ?></button> |
|
2098 |
||
2099 |
<?php if ( ! $bulk ) : ?> |
|
16 | 2100 |
<span class="spinner"></span> |
2101 |
<?php endif; ?> |
|
2102 |
||
2103 |
<input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" /> |
|
2104 |
<input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" /> |
|
2105 |
<?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) : ?> |
|
2106 |
<input type="hidden" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" /> |
|
2107 |
<?php endif; ?> |
|
2108 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2109 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2110 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2111 |
'<p class="error"></p>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2112 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2113 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2114 |
'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2115 |
'paragraph_wrap' => false, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2116 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2117 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2118 |
?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
2119 |
</div> |
19 | 2120 |
</div> <!-- end of .inline-edit-wrapper --> |
16 | 2121 |
|
2122 |
</td></tr> |
|
2123 |
||
9 | 2124 |
<?php |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2125 |
++$bulk; |
16 | 2126 |
endwhile; |
9 | 2127 |
?> |
16 | 2128 |
</tbody></table> |
2129 |
</form> |
|
9 | 2130 |
<?php |
0 | 2131 |
} |
2132 |
} |