Changeset 43982 for trunk/src/wp-includes/meta.php
- Timestamp:
- 12/12/2018 03:02:00 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43729
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/meta.php
r43582 r43982 614 614 $id_column = ( 'user' == $meta_type ) ? 'umeta_id' : 'meta_id'; 615 615 616 /** 617 * Filters whether to retrieve metadata of a specific type by meta ID. 618 * 619 * The dynamic portion of the hook, `$meta_type`, refers to the meta 620 * object type (comment, post, term, or user). Returning a non-null value 621 * will effectively short-circuit the function. 622 * 623 * @since 5.0.0 624 * 625 * @param mixed $value The value get_metadata_by_mid() should return. 626 * @param int $meta_id Meta ID. 627 */ 628 $check = apply_filters( "get_{$meta_type}_metadata_by_mid", null, $meta_id ); 629 if ( null !== $check ) { 630 return $check; 631 } 632 616 633 $meta = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE $id_column = %d", $meta_id ) ); 617 634 … … 660 677 $column = sanitize_key( $meta_type . '_id' ); 661 678 $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id'; 679 680 /** 681 * Filters whether to update metadata of a specific type by meta ID. 682 * 683 * The dynamic portion of the hook, `$meta_type`, refers to the meta 684 * object type (comment, post, term, or user). Returning a non-null value 685 * will effectively short-circuit the function. 686 * 687 * @since 5.0.0 688 * 689 * @param null|bool $check Whether to allow updating metadata for the given type. 690 * @param int $meta_id Meta ID. 691 * @param mixed $meta_value Meta value. Must be serializable if non-scalar. 692 * @param string|bool $meta_key Meta key, if provided. 693 */ 694 $check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key ); 695 if ( null !== $check ) { 696 return (bool) $check; 697 } 662 698 663 699 // Fetch the meta and go on if it's found. … … 755 791 $column = sanitize_key( $meta_type . '_id' ); 756 792 $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id'; 793 794 /** 795 * Filters whether to delete metadata of a specific type by meta ID. 796 * 797 * The dynamic portion of the hook, `$meta_type`, refers to the meta 798 * object type (comment, post, term, or user). Returning a non-null value 799 * will effectively short-circuit the function. 800 * 801 * @since 5.0.0 802 * 803 * @param null|bool $delete Whether to allow metadata deletion of the given type. 804 * @param int $meta_id Meta ID. 805 */ 806 $check = apply_filters( "delete_{$meta_type}_metadata_by_mid", null, $meta_id ); 807 if ( null !== $check ) { 808 return (bool) $check; 809 } 757 810 758 811 // Fetch the meta and go on if it's found. … … 841 894 842 895 $object_ids = array_map( 'intval', $object_ids ); 896 897 /** 898 * Filters whether to update the metadata cache of a specific type. 899 * 900 * The dynamic portion of the hook, `$meta_type`, refers to the meta 901 * object type (comment, post, term, or user). Returning a non-null value 902 * will effectively short-circuit the function. 903 * 904 * @since 5.0.0 905 * 906 * @param mixed $check Whether to allow updating the meta cache of the given type. 907 * @param array $object_ids Array of object IDs to update the meta cache for. 908 */ 909 $check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids ); 910 if ( null !== $check ) { 911 return (bool) $check; 912 } 843 913 844 914 $cache_key = $meta_type . '_meta';
Note: See TracChangeset
for help on using the changeset viewer.