Changeset 43729 for branches/5.0/src/wp-includes/meta.php
- Timestamp:
- 10/15/2018 11:45:16 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/meta.php
r43706 r43729 587 587 $id_column = ( 'user' == $meta_type ) ? 'umeta_id' : 'meta_id'; 588 588 589 /** 590 * Filters whether to retrieve metadata of a specific type by meta ID. 591 * 592 * The dynamic portion of the hook, `$meta_type`, refers to the meta 593 * object type (comment, post, term, or user). Returning a non-null value 594 * will effectively short-circuit the function. 595 * 596 * @since 5.0.0 597 * 598 * @param mixed $value The value get_metadata_by_mid() should return. 599 * @param int $meta_id Meta ID. 600 */ 601 $check = apply_filters( "get_{$meta_type}_metadata_by_mid", null, $meta_id ); 602 if ( null !== $check ) { 603 return $check; 604 } 605 589 606 $meta = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE $id_column = %d", $meta_id ) ); 590 607 … … 631 648 $column = sanitize_key($meta_type . '_id'); 632 649 $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id'; 650 651 /** 652 * Filters whether to update metadata of a specific type by meta ID. 653 * 654 * The dynamic portion of the hook, `$meta_type`, refers to the meta 655 * object type (comment, post, term, or user). Returning a non-null value 656 * will effectively short-circuit the function. 657 * 658 * @since 5.0.0 659 * 660 * @param null|bool $check Whether to allow updating metadata for the given type. 661 * @param int $meta_id Meta ID. 662 * @param mixed $meta_value Meta value. Must be serializable if non-scalar. 663 * @param string|bool $meta_key Meta key, if provided. 664 */ 665 $check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key ); 666 if ( null !== $check ) { 667 return (bool) $check; 668 } 633 669 634 670 // Fetch the meta and go on if it's found. … … 725 761 $column = sanitize_key($meta_type . '_id'); 726 762 $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id'; 763 764 /** 765 * Filters whether to delete metadata of a specific type by meta ID. 766 * 767 * The dynamic portion of the hook, `$meta_type`, refers to the meta 768 * object type (comment, post, term, or user). Returning a non-null value 769 * will effectively short-circuit the function. 770 * 771 * @since 5.0.0 772 * 773 * @param null|bool $delete Whether to allow metadata deletion of the given type. 774 * @param int $meta_id Meta ID. 775 */ 776 $check = apply_filters( "delete_{$meta_type}_metadata_by_mid", null, $meta_id ); 777 if ( null !== $check ) { 778 return (bool) $check; 779 } 727 780 728 781 // Fetch the meta and go on if it's found. … … 811 864 812 865 $object_ids = array_map('intval', $object_ids); 866 867 /** 868 * Filters whether to update the metadata cache of a specific type. 869 * 870 * The dynamic portion of the hook, `$meta_type`, refers to the meta 871 * object type (comment, post, term, or user). Returning a non-null value 872 * will effectively short-circuit the function. 873 * 874 * @since 5.0.0 875 * 876 * @param mixed $check Whether to allow updating the meta cache of the given type. 877 * @param array $object_ids Array of object IDs to update the meta cache for. 878 */ 879 $check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids ); 880 if ( null !== $check ) { 881 return (bool) $check; 882 } 813 883 814 884 $cache_key = $meta_type . '_meta';
Note: See TracChangeset
for help on using the changeset viewer.