Changeset 58129
- Timestamp:
- 05/10/2024 06:07:17 PM (7 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/export.php
r56633 r58129 239 239 <option value="0"><?php _e( 'All' ); ?></option> 240 240 <?php 241 $post_stat i= get_post_stati( array( 'internal' => false ), 'objects' );242 foreach ( $post_stat ias $status ) :241 $post_statuses = get_post_stati( array( 'internal' => false ), 'objects' ); 242 foreach ( $post_statuses as $status ) : 243 243 ?> 244 244 <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> … … 290 290 <select name="page_status" id="page-status"> 291 291 <option value="0"><?php _e( 'All' ); ?></option> 292 <?php foreach ( $post_stat ias $status ) : ?>292 <?php foreach ( $post_statuses as $status ) : ?> 293 293 <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> 294 294 <?php endforeach; ?> -
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r57644 r58129 238 238 $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments(); 239 239 240 $stat i= array(240 $statuses = array( 241 241 /* translators: %s: Number of comments. */ 242 242 'all' => _nx_noop( … … 283 283 284 284 if ( ! EMPTY_TRASH_DAYS ) { 285 unset( $stat i['trash'] );285 unset( $statuses['trash'] ); 286 286 } 287 287 … … 292 292 } 293 293 294 foreach ( $stat ias $status => $label ) {294 foreach ( $statuses as $status => $label ) { 295 295 if ( 'mine' === $status ) { 296 296 $current_user_id = get_current_user_id(); -
trunk/src/wp-admin/includes/meta-boxes.php
r57136 r58129 1680 1680 } 1681 1681 1682 $stati = get_post_stati( array( 'public' => true ) ); 1683 if ( empty( $stati ) ) { 1684 $stati = array( 'publish' ); 1685 } 1686 $stati[] = 'private'; 1687 1688 if ( in_array( get_post_status( $post ), $stati, true ) ) { 1682 $statuses = get_post_stati( array( 'public' => true ) ); 1683 1684 if ( empty( $statuses ) ) { 1685 $statuses = array( 'publish' ); 1686 } 1687 1688 $statuses[] = 'private'; 1689 1690 if ( in_array( get_post_status( $post ), $statuses, true ) ) { 1689 1691 /* 1690 1692 * If the post type support comments, or the post has comments, -
trunk/src/wp-admin/includes/post.php
r57860 r58129 1200 1200 */ 1201 1201 function get_available_post_statuses( $type = 'post' ) { 1202 $stat i= wp_count_posts( $type );1203 1204 return array_keys( get_object_vars( $stat i) );1202 $statuses = wp_count_posts( $type ); 1203 1204 return array_keys( get_object_vars( $statuses ) ); 1205 1205 } 1206 1206 … … 1218 1218 $q = $_GET; 1219 1219 } 1220 $q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0; 1221 $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0; 1222 $post_stati = get_post_stati(); 1220 1221 $q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0; 1222 $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0; 1223 1224 $post_statuses = get_post_stati(); 1223 1225 1224 1226 if ( isset( $q['post_type'] ) && in_array( $q['post_type'], get_post_types(), true ) ) { … … 1232 1234 $perm = ''; 1233 1235 1234 if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stat i, true ) ) {1236 if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_statuses, true ) ) { 1235 1237 $post_status = $q['post_status']; 1236 1238 $perm = 'readable'; -
trunk/tests/phpunit/tests/includes/helpers.php
r52010 r58129 226 226 _unregister_post_status( 'foo' ); 227 227 228 $stat i= get_post_stati();229 230 $this->assertArrayNotHasKey( 'foo', $stat i);228 $statuses = get_post_stati(); 229 230 $this->assertArrayNotHasKey( 'foo', $statuses ); 231 231 } 232 232
Note: See TracChangeset
for help on using the changeset viewer.