Making WordPress.org


Ignore:
Timestamp:
08/11/2020 09:43:27 PM (5 years ago)
Author:
coreymckrill
Message:

WP.org Learn: Sync with GitHub

https://github.com/WordPress/learn/compare/85688cdceee0a1645c3f5bb32b52604cf1a437b5...826f579465d0a1689ef260161158b585197d6112

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php

    r10131 r10146  
    5555        ),
    5656    );
    57    
    58     // Get all the lesson plans associated to 
     57
     58    // Get all the lesson plans associated to
    5959    return new WP_Query( $args );
    6060}
     
    9696function wporg_get_cat_or_default_slug() {
    9797    $cat = wporg_get_filter_category();
    98    
     98
    9999    if( empty( $cat ) ) {
    100100        return wporg_get_default_cat()->slug;
     
    110110 * @param string $id Id of the post
    111111 * @param string $tax_slug The slug for the custom taxonomy
    112  * @return string 
     112 * @return string
    113113 */
    114114function get_taxonomy_values( $id, $tax_slug ){
     
    186186
    187187/**
    188  * Submit CTA button 
    189  *
    190  * @package WPBBP
    191  */
    192 function wporg_submit_idea_cta() { ?> 
     188 * Submit CTA button
     189 *
     190 * @package WPBBP
     191 */
     192function wporg_submit_idea_cta() { ?>
    193193
    194194    <section class="submit-idea-cta">
    195195        <div class="content-icon"><span class="dashicons dashicons-lightbulb"></span></div>
    196         <h3><?php _e( 'Have an Idea for a Workshop? Let us know!' ); ?></h3>
    197         <a class="button button-primary button-large" href="<?php echo esc_url( site_url( '/submit-an-idea/' ) ); ?>"><?php _e( 'Submit an Idea' ); ?></a>
     196        <h2><?php _e( 'Have an Idea for a Workshop? Let us know!' ); ?></h2>
     197        <a class="button button-primary button-large" href="https://wordcampcentral.survey.fm/learn-wordpress-workshop-application"><?php _e( 'Submit an Idea' ); ?></a>
    198198    </section>
    199199
    200 <?php } 
     200<?php }
    201201
    202202/**
     
    213213        $args = array_merge( $args, $options );
    214214
    215     } 
     215    }
    216216
    217217    $query = new \WP_Query( $args );
    218218    return $query;
    219219}
     220
     221/**
     222 * Returns the presenters for the workshop.
     223 *
     224 * @param WP_Post|int $workshop
     225 *
     226 * @return WP_User[]|array
     227 */
     228function wporg_get_workshop_presenters( $workshop = null ) {
     229    $post       = get_post( $workshop );
     230    $presenters = get_post_meta( $post->ID, 'presenter_wporg_username' );
     231    $wp_users   = array();
     232
     233    foreach ( $presenters as $presenter ) {
     234        $wp_user = get_user_by( 'login', $presenter );
     235
     236        if ( $wp_user ) {
     237            array_push( $wp_users, $wp_user );
     238        }
     239    }
     240
     241    return $wp_users;
     242}
Note: See TracChangeset for help on using the changeset viewer.