| | 579 | /** |
| | 580 | * Filter whether to retrieve metadata of a specific type by its meta ID. |
| | 581 | * |
| | 582 | * The dynamic portion of the hook, `$meta_type`, refers to the meta |
| | 583 | * object type (comment, post, or user). Returning a non-null value |
| | 584 | * will effectively short-circuit the retrieval. |
| | 585 | * |
| | 586 | * @since x.y.z |
| | 587 | * |
| | 588 | * @param null|object $value Whether to retrieve the meta row object. |
| | 589 | * @param int mixed $meta_id Meta row ID. |
| | 590 | */ |
| | 591 | $check = apply_filters( "get_{$meta_type}_meta_by_mid", null, $meta_id ); |
| | 592 | if ( null !== $check ) { |
| | 593 | if ( empty( $check ) ) { |
| | 594 | return false; |
| | 595 | } |
| | 596 | |
| | 597 | if ( isset( $check->meta_value ) ) { |
| | 598 | $check->meta_value = maybe_unserialize( $check->meta_value ); |
| | 599 | } |
| | 600 | |
| | 601 | return $check; |
| | 602 | } |
| | 603 | |
| | 649 | /** |
| | 650 | * Filter whether to update metadata of a specific type by its meta ID. |
| | 651 | * |
| | 652 | * The dynamic portion of the hook, `$meta_type`, refers to the meta |
| | 653 | * object type (comment, post, or user). Returning a non-null value |
| | 654 | * will effectively short-circuit the update. |
| | 655 | * |
| | 656 | * @since x.y.z |
| | 657 | * |
| | 658 | * @param null|bool $check Whether to allow updating metadata for the given type. |
| | 659 | * @param int $meta_id Meta row ID. |
| | 660 | * @param mixed $meta_value Meta value. Must be serializable if non-scalar. |
| | 661 | * @param string|bool $meta_key Meta key to update. |
| | 662 | */ |
| | 663 | $check = apply_filters( "update_{$meta_type}_meta_by_mid", null, $meta_id, $meta_value, $meta_key ); |
| | 664 | if ( null !== $check ) { |
| | 665 | return false; |
| | 666 | } |
| | 667 | |
| | 758 | /** |
| | 759 | * Filter whether to delete metadata of a specific type by its meta ID. |
| | 760 | * |
| | 761 | * The dynamic portion of the hook, `$meta_type`, refers to the meta |
| | 762 | * object type (comment, post, or user). Returning a non-null value |
| | 763 | * will effectively short-circuit the deletion. |
| | 764 | * |
| | 765 | * @since x.y.z |
| | 766 | * |
| | 767 | * @param null|bool $check Whether to allow deleting metadata for the given type. |
| | 768 | * @param int $meta_id Meta row ID. |
| | 769 | */ |
| | 770 | $check = apply_filters( "delete_{$meta_type}_meta_by_mid", null, $meta_id ); |
| | 771 | if ( null !== $check ) { |
| | 772 | return false; |
| | 773 | } |
| | 774 | |