Changeset 3320
- Timestamp:
- 06/08/2016 06:51:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r3319 r3320 555 555 return array( $ratings ); 556 556 break; 557 case false: 558 // In the event $meta_key is false, the caller wants all meta fields, so we'll append our custom ones here too. 559 remove_filter( 'get_post_metadata', array( $this, 'filter_shim_postmeta' ) ); 560 561 // Fetch the existing ones from the database 562 $value = get_metadata( 'post', $object_id, $meta_key ); 563 564 // Re-attach ourselves for next time! 565 add_filter( 'get_post_metadata', array( $this, 'filter_shim_postmeta' ), 10, 3 ); 566 567 $custom_meta_fields = array( 'downloads', 'rating', 'ratings' ); 568 $custom_meta_fields = apply_filters( 'wporg_plugins_custom_meta_fields', $custom_meta_fields, $object_id ); 569 570 foreach ( $custom_meta_fields as $key ) { 571 // When WordPress calls `get_post_meta( $post_id, false )` it expects an array of maybe_serialize()'d data 572 $shimed_data = $this->filter_shim_postmeta( false, $object_id, $key ); 573 if ( $shimed_data ) { 574 $value[ $key ][0] = (string) maybe_serialize( $shimed_data[0] ); 575 } 576 } 577 578 break; 557 579 } 558 580 return $value;
Note: See TracChangeset
for help on using the changeset viewer.