Making WordPress.org


Ignore:
Timestamp:
09/28/2022 11:18:13 PM (4 years ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@f49e45d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-workshop-details.php

    r11966 r12096  
    1515?>
    1616
    17 <div class="wp-block-wporg-learn-workshop-details">
    18         <h3 class="screen-reader-text"><?php esc_html_e( 'Workshop Details', 'wporg-learn' ); ?></h3>
    19         <?php if ( ! empty( $fields ) ) : ?>
    20                 <ul class="workshop-details-list">
    21                         <?php foreach ( $fields as $key => $field ) : ?>
     17<?php if ( get_post_type() === 'wporg_workshop' ) : ?>
     18        <div class="wp-block-wporg-learn-workshop-details">
     19                <h3 class="screen-reader-text"><?php esc_html_e( 'Workshop Details', 'wporg-learn' ); ?></h3>
     20                <?php if ( ! empty( $fields ) ) : ?>
     21                        <ul class="workshop-details-list">
     22                                <?php foreach ( $fields as $key => $field ) : ?>
     23                                        <li>
     24                                                <b><?php echo esc_html( $field['label'] ); ?></b>
     25                                                <span>
     26                                                        <?php
     27                                                        $i = 0;
     28                                                        foreach ( $field['value'] as $field_key => $value ) {
     29                                                                $url = '';
     30                                                                if ( ! empty( $field['param'] ) ) {
     31                                                                        $url = trailingslashit( site_url() ) . 'tutorials/?' . $key . '=' . $field['param'][ $field_key ];
     32                                                                }
     33
     34                                                                if ( 0 < $i ) {
     35                                                                        echo ', ';
     36                                                                }
     37
     38                                                                if ( $url ) {
     39                                                                        echo '<a href="' . esc_url( $url ) . '">' . esc_html( $value ) . '</a>';
     40                                                                } else {
     41                                                                        echo esc_html( $value );
     42                                                                }
     43                                                                $i++;
     44                                                        }
     45                                                        ?>
     46                                                </span>
     47                                        </li>
     48                                <?php endforeach; ?>
     49
     50                                <?php if ( $has_transcript ) : ?>
     51                                        <li>
     52                                                <b><?php esc_html_e( 'Transcript', 'wporg-learn' ); ?></b>
     53                                                <span>
     54                                                        <a class="components-button is-secondary is-small" href="#transcript" aria-label="<?php esc_attr_e( 'View Transcript', 'wporg-learn' ); ?>">
     55                                                                <?php esc_html_e( 'View', 'wporg-learn' ); ?>
     56                                                        </a>
     57                                                </span>
     58                                        </li>
     59                                <?php endif; ?>
    2260                                <li>
    23                                         <b><?php echo esc_html( $field['label'] ); ?></b>
     61                                        <b><?php esc_html_e( 'Print View', 'wporg-learn' ); ?></b>
    2462                                        <span>
    25                                                 <?php
    26                                                 $i = 0;
    27                                                 foreach ( $field['value'] as $field_key => $value ) {
    28                                                         $url = '';
    29                                                         if ( ! empty( $field['param'] ) ) {
    30                                                                 $url = trailingslashit( site_url() ) . 'tutorials/?' . $key . '=' . $field['param'][ $field_key ];
    31                                                         }
     63                                                        <a class="components-button is-secondary is-small" href="#" onclick="window.print();" aria-label="<?php esc_attr_e( 'Print View', 'wporg-learn' ); ?>">
     64                                                                <?php esc_html_e( 'View', 'wporg-learn' ); ?>
     65                                                        </a>
     66                                                </span>
     67                                </li>
     68                        </ul>
     69                <?php endif; ?>
    3270
    33                                                         if ( 0 < $i ) {
    34                                                                 echo ', ';
    35                                                         }
    36 
    37                                                         if ( $url ) {
    38                                                                 echo '<a href="' . esc_url( $url ) . '">' . esc_html( $value ) . '</a>';
    39                                                         } else {
    40                                                                 echo esc_html( $value );
    41                                                         }
    42                                                         $i++;
    43                                                 }
    44                                                 ?>
    45                                         </span>
    46                                 </li>
    47                         <?php endforeach; ?>
    48 
    49                         <?php if ( $has_transcript ) : ?>
    50                                 <li>
    51                                         <b><?php esc_html_e( 'Transcript', 'wporg-learn' ); ?></b>
    52                                         <span>
    53                                                 <a class="components-button is-secondary is-small" href="#transcript" aria-label="<?php esc_attr_e( 'View Transcript', 'wporg-learn' ); ?>">
    54                                                         <?php esc_html_e( 'View', 'wporg-learn' ); ?>
    55                                                 </a>
    56                                         </span>
    57                                 </li>
    58                         <?php endif; ?>
    59                         <li>
    60                                 <b><?php esc_html_e( 'Print View', 'wporg-learn' ); ?></b>
    61                                 <span>
    62                                                 <a class="components-button is-secondary is-small" href="#" onclick="window.print();" aria-label="<?php esc_attr_e( 'Print View', 'wporg-learn' ); ?>">
    63                                                         <?php esc_html_e( 'View', 'wporg-learn' ); ?>
    64                                                 </a>
    65                                         </span>
    66                         </li>
    67                 </ul>
    68         <?php endif; ?>
    69 
    70         <?php if ( ! empty( $quiz_url ) ) : ?>
    71                 <div class="wp-block-button is-style-primary-full-width">
    72                         <a class="wp-block-button__link" href="<?php echo esc_attr( $quiz_url ); ?>" style="border-radius:5px">
    73                                 <?php esc_html_e( 'Take a Quiz, Test Your Knowledge', 'wporg-learn' ); ?>
     71                <?php if ( ! empty( $quiz_url ) ) : ?>
     72                        <div class="wp-block-button is-style-primary-full-width">
     73                                <a class="wp-block-button__link" href="<?php echo esc_attr( $quiz_url ); ?>" style="border-radius:5px">
     74                                        <?php esc_html_e( 'Take a Quiz, Test Your Knowledge', 'wporg-learn' ); ?>
     75                                </a>
     76                        </div>
     77                <?php endif; ?>
     78                <div class="wp-block-button is-style-secondary-full-width">
     79                        <a
     80                                class="wp-block-button__link"
     81                                href="https://learn.wordpress.org/online-workshops/"
     82                                style="border-radius:5px"
     83                        >
     84                                <?php esc_html_e( 'Join a live Online Workshop', 'wporg-learn' ); ?>
    7485                        </a>
    7586                </div>
    76         <?php endif; ?>
    77         <div class="wp-block-button is-style-secondary-full-width">
    78                 <a
    79                         class="wp-block-button__link"
    80                         href="https://learn.wordpress.org/online-workshops/"
    81                         style="border-radius:5px"
    82                 >
    83                         <?php esc_html_e( 'Join a live Online Workshop', 'wporg-learn' ); ?>
    84                 </a>
    8587        </div>
    86 </div>
     88<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.