Yoast\WP\SEO\Introductions\Infrastructure
Wistia_Embed_Permission_Repository::set_value_for_user()
Sets the Wistia embed permission value for the current user.
Метод класса: Wistia_Embed_Permission_Repository{}
Хуков нет.
Возвращает
true|false
. Whether the update was successful.
Использование
$Wistia_Embed_Permission_Repository = new Wistia_Embed_Permission_Repository(); $Wistia_Embed_Permission_Repository->set_value_for_user( $user_id, $value );
- $user_id(int) (обязательный)
- The user ID.
- $value(true|false) (обязательный)
- The value.
Код Wistia_Embed_Permission_Repository::set_value_for_user() Wistia Embed Permission Repository::set value for user Yoast 24.4
public function set_value_for_user( $user_id, $value ) { // The value is stored as a string because otherwise we can not see the difference between false and an invalid user ID. $value_as_string = ( $value === true ) ? '1' : '0'; // Checking for only false, not interested in not having to update. return $this->user_helper->update_meta( $user_id, self::USER_META_KEY, $value_as_string ) !== false; }