Yoast\WP\SEO\User_Meta\User_Interface
Additional_Contactmethods_Integration::stop_storing_empty_metadata()
Returns a check value, which will stop empty contactmethods from going into the database.
Метод класса: Additional_Contactmethods_Integration{}
Хуков нет.
Возвращает
false|null
. False for when we are to filter out empty metadata, null for no filtering.
Использование
$Additional_Contactmethods_Integration = new Additional_Contactmethods_Integration(); $Additional_Contactmethods_Integration->stop_storing_empty_metadata( $check, $object_id, $meta_key, $meta_value );
- $check(true|false|null) (обязательный)
- Whether to allow updating metadata for the given type.
- $object_id(int) (обязательный)
- ID of the object metadata is for.
- $meta_key(строка) (обязательный)
- Metadata key.
- $meta_value(разное) (обязательный)
- Metadata value. Must be serializable if non-scalar.
Код Additional_Contactmethods_Integration::stop_storing_empty_metadata() Additional Contactmethods Integration::stop storing empty metadata Yoast 25.0
public function stop_storing_empty_metadata( $check, $object_id, $meta_key, $meta_value ) { $additional_contactmethods = $this->additional_contactmethods_collector->get_additional_contactmethods_keys(); if ( \in_array( $meta_key, $additional_contactmethods, true ) && $meta_value === '' ) { \delete_user_meta( $object_id, $meta_key ); return false; } return $check; }