Changeset 2994 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php
- Timestamp:
- 04/21/2016 07:41:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php
r2991 r2994 8 8 9 9 /** 10 * Plugin API response about the current plugin displayed. 11 * 12 * @var object 13 */ 14 protected $plugin_meta; 15 16 /** 17 * 18 * @global array $avail_post_stati 19 * @global WP_Query $wp_query 20 * @global int $per_page 21 * @global string $mode 10 * 11 * @global array $avail_post_stati 12 * @global \WP_Query $wp_query 13 * @global int $per_page 14 * @global string $mode 22 15 */ 23 16 public function prepare_items() { … … 137 130 $classes[] = 'level-0'; 138 131 } 139 140 //@TODO: Switch to using the API class directly (once rewritten), or even better, post meta.141 require_once ABSPATH . '/wp-admin/includes/plugin-install.php';142 $this->plugin_meta = \plugins_api( 'plugin_information', array(143 'slug' => $post->post_name,144 ) );145 132 ?> 146 133 <tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>"> … … 172 159 */ 173 160 public function column_rating( $post ) { 174 if ( ! empty( $this->plugin_meta->rating ) && function_exists( 'wporg_get_dashicons_stars' ) ) { 175 echo wporg_get_dashicons_stars( $this->plugin_meta->rating / 20 ); 161 $rating = (string) get_post_meta( $post->ID, 'avg_rating', true ); 162 if ( ! empty( $rating ) && function_exists( 'wporg_get_dashicons_stars' ) ) { 163 echo wporg_get_dashicons_stars( $rating / 20 ); 176 164 } 177 165 } … … 306 294 * 'Edit', 'Quick Edit', 'Restore, 'Trash', 307 295 * 'Delete Permanently', 'Preview', and 'View'. 308 * @param WP_Post $post The post object.296 * @param \WP_Post $post The post object. 309 297 */ 310 298 $actions = apply_filters( 'page_row_actions', $actions, $post ); … … 319 307 * 'Edit', 'Quick Edit', 'Restore, 'Trash', 320 308 * 'Delete Permanently', 'Preview', and 'View'. 321 * @param WP_Post $post The post object.309 * @param \WP_Post $post The post object. 322 310 */ 323 311 $actions = apply_filters( 'post_row_actions', $actions, $post );
Note: See TracChangeset
for help on using the changeset viewer.