Making WordPress.org


Ignore:
Timestamp:
09/03/2020 11:57:12 PM (3 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

https://github.com/WordPress/learn/compare/fcab3279c24740fb625278be5fd3484157df8941...81fc947c7f4f4174ef30a2f6c9fc42d3608e5a49

File:
1 edited

Legend:

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

    r10202 r10237  
    199199    return get_post_meta( get_the_ID(), 'download_lesson_plan_slides_url', true );
    200200}
     201
     202/**
     203 * Modify the excerpt length for our custom post types.
     204 *
     205 * @param int $length Excerpt length.
     206 *
     207 * @return int (Maybe) modified excerpt length.
     208 */
     209function wporg_modify_excerpt_length( $length ) {
     210    if ( is_admin() ) {
     211        return $length;
     212    }
     213
     214    if ( 'wporg_workshop' === get_post_type() ) {
     215        return 35;
     216    }
     217
     218    return 25;
     219}
     220add_filter( 'excerpt_length', 'wporg_modify_excerpt_length', 999 );
    201221
    202222/**
Note: See TracChangeset for help on using the changeset viewer.