Making WordPress.org

Changeset 13953


Ignore:
Timestamp:
08/07/2024 08:43:54 AM (11 months ago)
Author:
paulkevan
Message:

wporg-support: revert r13952 due to fatals.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub
Files:
1 edited
1 copied

Legend:

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

    r13765 r13953  
    437437 */
    438438require get_stylesheet_directory() . '/inc/template-tags.php';
     439
     440function filter_plugin_card_classes( $taxonomies, $post_id, $classes, $css_class ) {
     441
     442    // Only filter on `plugin-card` class.
     443    if ( 'plugin-card' != $css_class ) {
     444        print_r( $classes  );
     445        print_r( $css_class );
     446        return $taxonomies;
     447    }
     448
     449    $filtered_taxonomies = [];
     450    $skip_taxonomy = [ 'plugin_contributors', 'plugin_committers', 'plugin_support_reps' ];
     451    foreach ( $taxonomies as $tax ) {
     452        if ( ! in_array( $tax, $skip_taxonomy ) ) {
     453            $filtered_taxonomies[] = $tax;
     454        }   
     455    }
     456    return $filtered_taxonomies;
     457}
     458
     459//add_filter( 'post_class_taxonomies', __NAMESPACE__ . '\filter_plugin_card_classes', 10, 4 );
     460
     461
     462add_filter( 'wp_trim_words', function( $text, $num_words, $more, $original_text ) {
     463    $text = str_replace( '\n', ' ', $text );
     464    echo $original_text;
     465    return $text;
     466}, 10, 4 );
Note: See TracChangeset for help on using the changeset viewer.