Making WordPress.org


Ignore:
Timestamp:
09/05/2022 08:21:02 PM (2 years ago)
Author:
iandunn
Message:

Developer: Sync with Git 41e97d9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/explanations.php

    r12030 r12053  
    144144            $url = parse_url( $preview_link );
    145145            $url_query = array();
    146             parse_str ( $url['query'], $url_query );
     146            parse_str( $url['query'], $url_query );
    147147
    148148            $preview_link = get_preview_post_link(
     
    184184                    $menu[ $i ][0] = sprintf(
    185185                        __( '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>'
    187187                    );
    188188                    break;
     
    274274                    <strong><?php _e( 'Associated with: ', 'wporg' ); ?></strong>
    275275                    <?php
    276                     printf( '<a href="%1$s">%2$s</a>',
     276                    printf(
     277                        '<a href="%1$s">%2$s</a>',
    277278                        esc_url( get_permalink( $post->post_parent ) ),
    278279                        str_replace( 'Explanation: ', '', get_the_title( $post->post_parent ) )
     
    357358        if ( in_array( $role, array( 'administrator', 'editor', 'expl_editor' ) ) ) {
    358359            $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',
    361364            );
    362365
     
    367370            $editor_caps = array(
    368371                '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',
    372378            );
    373379
     
    405411            }
    406412
    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>',
    408415                esc_url( get_edit_post_link( $expl->ID ) ),
    409416                esc_attr__( 'Edit Explanation', 'wporg' ),
     
    411418            );
    412419        } 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>',
    414422                esc_attr( wp_create_nonce( 'create-expl' ) ),
    415423                esc_attr( $post->ID ),
     
    451459                </a><!-- #create-explanation -->
    452460            </span><!-- expl-row-actions -->
    453         <?php
     461            <?php
    454462        endif;
    455463    }
     
    468476        }
    469477
    470         switch( $status = $post->post_status ) {
    471             case 'draft' :
     478        switch ( $status = $post->post_status ) {
     479            case 'draft':
    472480                $label = __( 'Draft', 'wporg' );
    473481                break;
    474             case 'pending' :
     482            case 'pending':
    475483                $label = __( 'Pending Review', 'wporg' );
    476484                break;
    477             case 'publish' :
     485            case 'publish':
    478486                $label = __( 'Published', 'wporg' );
    479487                break;
    480             default :
     488            default:
    481489                $status = '';
    482490                $label = __( 'None', 'wporg' );
     
    496504     */
    497505    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 );
    499507    }
    500508
     
    508516        $parsed_post_types_screen_ids = DevHub_Admin::get_parsed_post_types_screen_ids();
    509517
    510         if ( in_array( get_current_screen()->id, array_merge(
     518        if ( in_array(
     519            get_current_screen()->id,
     520            array_merge(
    511521                $parsed_post_types_screen_ids,
    512522                $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            );
    524545        }
    525546    }
     
    559580                );
    560581            }
    561 
    562582        }
    563583    }
     
    605625            $pos   = false === $index ? count( $columns ) : $index + 1;
    606626
    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            ];
    612634            $columns  = array_merge( array_slice( $columns, 0, $pos ), $col_data, array_slice( $columns, $pos ) );
    613635        }
Note: See TracChangeset for help on using the changeset viewer.