Making WordPress.org


Ignore:
Timestamp:
02/19/2024 02:45:18 AM (9 months ago)
Author:
dd32
Message:

Plugin Directory: Store a num_ratings post_meta for query filtering.

See #2753.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-meta-sync.php

    r12846 r13220  
    22namespace WordPressdotorg\Plugin_Directory\Jobs;
    33
     4use WPORG_Ratings;
    45use WordPressdotorg\Plugin_Directory\Plugin_Directory;
    56use WordPressdotorg\Plugin_Directory\Standalone\Plugins_Info_API;
     
    9091                $post->ID,
    9192                'rating',
    92                 \WPORG_Ratings::get_avg_rating( 'plugin', $post->post_name )
     93                WPORG_Ratings::get_avg_rating( 'plugin', $post->post_name )
    9394            );
    9495            update_post_meta(
    9596                $post->ID,
    9697                'ratings',
    97                 \WPORG_Ratings::get_rating_counts( 'plugin', $post->post_name )
     98                WPORG_Ratings::get_rating_counts( 'plugin', $post->post_name )
     99            );
     100            update_post_meta(
     101                $post->ID,
     102                'num_ratings',
     103                WPORG_Ratings::get_rating_count( 'plugin', $post->post_name )
    98104            );
    99105
Note: See TracChangeset for help on using the changeset viewer.