Changeset 10237 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php
- Timestamp:
- 09/03/2020 11:57:12 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/functions.php
r10202 r10237 199 199 return get_post_meta( get_the_ID(), 'download_lesson_plan_slides_url', true ); 200 200 } 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 */ 209 function 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 } 220 add_filter( 'excerpt_length', 'wporg_modify_excerpt_length', 999 ); 201 221 202 222 /**
Note: See TracChangeset
for help on using the changeset viewer.