Changeset 12053 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/explanations.php
- Timestamp:
- 09/05/2022 08:21:02 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/explanations.php
r12030 r12053 144 144 $url = parse_url( $preview_link ); 145 145 $url_query = array(); 146 parse_str 146 parse_str( $url['query'], $url_query ); 147 147 148 148 $preview_link = get_preview_post_link( … … 184 184 $menu[ $i ][0] = sprintf( 185 185 __( 'Explanations %s', 'wporg' ), 186 "<span class='update-plugins count-{$count}'><span class='plugin-count'>" . number_format_i18n( $count ) . "</span></span>"186 "<span class='update-plugins count-{$count}'><span class='plugin-count'>" . number_format_i18n( $count ) . '</span></span>' 187 187 ); 188 188 break; … … 274 274 <strong><?php _e( 'Associated with: ', 'wporg' ); ?></strong> 275 275 <?php 276 printf( '<a href="%1$s">%2$s</a>', 276 printf( 277 '<a href="%1$s">%2$s</a>', 277 278 esc_url( get_permalink( $post->post_parent ) ), 278 279 str_replace( 'Explanation: ', '', get_the_title( $post->post_parent ) ) … … 357 358 if ( in_array( $role, array( 'administrator', 'editor', 'expl_editor' ) ) ) { 358 359 $base_caps = array( 359 'edit_explanations', 'edit_others_explanations', 360 'edit_published_explanations', 'edit_posts' 360 'edit_explanations', 361 'edit_others_explanations', 362 'edit_published_explanations', 363 'edit_posts', 361 364 ); 362 365 … … 367 370 $editor_caps = array( 368 371 'publish_explanations', 369 'delete_explanations', 'delete_others_explanations', 370 'delete_published_explanations', 'delete_private_explanations', 371 'edit_private_explanations', 'read_private_explanations' 372 'delete_explanations', 373 'delete_others_explanations', 374 'delete_published_explanations', 375 'delete_private_explanations', 376 'edit_private_explanations', 377 'read_private_explanations', 372 378 ); 373 379 … … 405 411 } 406 412 407 $expl_action['edit-expl'] = sprintf( '<a href="%1$s" alt="%2$s">%3$s</a>', 413 $expl_action['edit-expl'] = sprintf( 414 '<a href="%1$s" alt="%2$s">%3$s</a>', 408 415 esc_url( get_edit_post_link( $expl->ID ) ), 409 416 esc_attr__( 'Edit Explanation', 'wporg' ), … … 411 418 ); 412 419 } else { 413 $expl_action['add-expl'] = sprintf( '<a href="" class="create-expl" data-nonce="%1$s" data-id="%2$s">%3$s</a>', 420 $expl_action['add-expl'] = sprintf( 421 '<a href="" class="create-expl" data-nonce="%1$s" data-id="%2$s">%3$s</a>', 414 422 esc_attr( wp_create_nonce( 'create-expl' ) ), 415 423 esc_attr( $post->ID ), … … 451 459 </a><!-- #create-explanation --> 452 460 </span><!-- expl-row-actions --> 453 <?php461 <?php 454 462 endif; 455 463 } … … 468 476 } 469 477 470 switch ( $status = $post->post_status ) {471 case 'draft' 478 switch ( $status = $post->post_status ) { 479 case 'draft': 472 480 $label = __( 'Draft', 'wporg' ); 473 481 break; 474 case 'pending' 482 case 'pending': 475 483 $label = __( 'Pending Review', 'wporg' ); 476 484 break; 477 case 'publish' 485 case 'publish': 478 486 $label = __( 'Published', 'wporg' ); 479 487 break; 480 default 488 default: 481 489 $status = ''; 482 490 $label = __( 'None', 'wporg' ); … … 496 504 */ 497 505 public function admin_enqueue_base_scripts( $do_enqueue ) { 498 return $do_enqueue || in_array( get_current_screen()->id, $this->screen_ids 506 return $do_enqueue || in_array( get_current_screen()->id, $this->screen_ids ); 499 507 } 500 508 … … 508 516 $parsed_post_types_screen_ids = DevHub_Admin::get_parsed_post_types_screen_ids(); 509 517 510 if ( in_array( get_current_screen()->id, array_merge( 518 if ( in_array( 519 get_current_screen()->id, 520 array_merge( 511 521 $parsed_post_types_screen_ids, 512 522 $this->screen_ids 513 ) ) ) { 514 wp_enqueue_script( 'wporg-explanations', get_template_directory_uri() . '/js/explanations.js', array( 'jquery', 'wp-util' ), '20160630', true ); 515 516 wp_localize_script( 'wporg-explanations', 'wporg', array( 517 'editContentLabel' => __( 'Edit Explanation', 'wporg' ), 518 'statusLabel' => array( 519 'draft' => __( 'Draft', 'wporg' ), 520 'pending' => __( 'Pending Review', 'wporg' ), 521 'publish' => __( 'Published', 'wporg' ), 522 ), 523 ) ); 523 ) 524 ) ) { 525 wp_enqueue_script( 526 'wporg-explanations', 527 get_template_directory_uri() . '/js/explanations.js', 528 array( 'jquery', 'wp-util' ), 529 filemtime( dirname( __DIR__ ) . '/js/explanations.js' ), 530 true 531 ); 532 533 wp_localize_script( 534 'wporg-explanations', 535 'wporg', 536 array( 537 'editContentLabel' => __( 'Edit Explanation', 'wporg' ), 538 'statusLabel' => array( 539 'draft' => __( 'Draft', 'wporg' ), 540 'pending' => __( 'Pending Review', 'wporg' ), 541 'publish' => __( 'Published', 'wporg' ), 542 ), 543 ) 544 ); 524 545 } 525 546 } … … 559 580 ); 560 581 } 561 562 582 } 563 583 } … … 605 625 $pos = false === $index ? count( $columns ) : $index + 1; 606 626 607 $col_data = [ 'has_explanation' => sprintf( 608 '<span class="dashicons dashicons-info" title="%s"></span><span class="screen-reader-text">%s</span>', 609 esc_attr__( 'Has explanation?', 'wporg' ), 610 esc_html__( 'Explanation?', 'wporg' ) 611 ) ]; 627 $col_data = [ 628 'has_explanation' => sprintf( 629 '<span class="dashicons dashicons-info" title="%s"></span><span class="screen-reader-text">%s</span>', 630 esc_attr__( 'Has explanation?', 'wporg' ), 631 esc_html__( 'Explanation?', 'wporg' ) 632 ), 633 ]; 612 634 $columns = array_merge( array_slice( $columns, 0, $pos ), $col_data, array_slice( $columns, $pos ) ); 613 635 }
Note: See TracChangeset
for help on using the changeset viewer.