WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/22/2016 06:17:23 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Add ratings count postmeta display to admin and plugin cards.
Still to come is a Widget to allow rating & reviewing a plugin.

See #1575

File:
1 edited

Legend:

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

    r2996 r2998  
    433433                return $single ? $count : array( $count );             
    434434                break;
     435            case 'rating':
     436                $post = get_post( $object_id );
     437                // The WordPress.org global ratings functions
     438                if ( ! function_exists( 'wporg_get_rating_avg' ) ) {
     439                    break;
     440                }
     441                $rating = wporg_get_rating_avg( 'plugin', $post->post_name );
     442
     443                return $single ? $rating : array( $rating );
     444                break;
    435445        }
    436446        return $value;
Note: See TracChangeset for help on using the changeset viewer.