Changeset 10661 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php
- Timestamp:
- 02/11/2021 11:38:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php
r10415 r10661 272 272 273 273 /** 274 * Noindex some requests: 275 * - all o2 taxonomy pages, rather than the default of only noindexing archives with less than 3 posts 276 * - Posts/pages/etc with less than 100char. 277 */ 278 function maybe_noindex( $noindex ) { 279 // Noindex all o2 taxonomy pages. 280 if ( is_tax() || is_tag() || is_category() ) { 281 $noindex = true; 282 } 283 284 // Noindex empty/short pages 285 if ( is_singular() && ( strlen( get_the_content() ) < 100 ) ) { 286 $noindex = true; 287 } 288 289 return $noindex; 290 } 291 add_filter( 'wporg_noindex_request', __NAMESPACE__ . '\maybe_noindex' ); 292 293 /** 274 294 * Register translations for plugins without their own GlotPress project. 275 295 */
Note: See TracChangeset
for help on using the changeset viewer.