✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.223
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/plugins/Core/Storage//Setting_With_Owned_Keys_Trait.php
<?php
/**
 * Trait Google\Site_Kit\Core\Storage\Setting_With_Owned_Keys_Trait
 *
 * @package   Google\Site_Kit\Core\Storage
 * @copyright 2021 Google LLC
 * @license   https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
 * @link      https://sitekit.withgoogle.com
 */

namespace Google\Site_Kit\Core\Storage;

use Google\Site_Kit\Core\Permissions\Permissions;
use Google\Site_Kit\Core\Storage\Setting;

/**
 * Trait for a Setting that has owner ID option key.
 *
 * @since 1.16.0
 * @access private
 * @ignore
 */
trait Setting_With_Owned_Keys_Trait {

	/**
	 * Returns keys for owned settings.
	 *
	 * @since 1.16.0
	 *
	 * @return array An array of keys for owned settings.
	 */
	abstract public function get_owned_keys();

	/**
	 * Registers hooks to determine an owner ID for a module.
	 *
	 * @since 1.16.0
	 */
	protected function register_owned_keys() {
		add_action(
			'add_option_' . static::OPTION,
			function ( $option, $settings ) {
				if ( ! current_user_can( Permissions::MANAGE_OPTIONS ) ) {
					return;
				}

				if ( ! is_array( $settings ) || ! $this instanceof Setting ) {
					return;
				}

				$defaults = $this->get_default();
				if ( ! is_array( $defaults ) ) {
					return;
				}

				if ( $this->have_owned_settings_changed( $settings, $defaults ) ) {
					$this->merge_initial_owner_id();
				}
			},
			10,
			2
		);

		add_filter(
			'pre_update_option_' . static::OPTION,
			function ( $settings, $old_settings ) {
				if (
					current_user_can( Permissions::MANAGE_OPTIONS ) &&
					is_array( $settings ) &&
					is_array( $old_settings ) &&
					$this->have_owned_settings_changed( $settings, $old_settings )
				) {
					return $this->update_owner_id_in_settings( $settings );
				}

				return $settings;
			},
			10,
			2
		);
	}

	/**
	 * Merges the current user ID into the module settings as the initial owner ID.
	 *
	 * @since 1.99.0
	 */
	protected function merge_initial_owner_id() {
		$this->merge( array( 'ownerID' => get_current_user_id() ) );
	}

	/**
	 * Adds the current user ID as the module owner ID to the current module settings.
	 *
	 * @since 1.99.0
	 *
	 * @param array $settings The new module settings.
	 * @return array Updated module settings with the current user ID as the ownerID setting.
	 */
	protected function update_owner_id_in_settings( $settings ) {
		$settings['ownerID'] = get_current_user_id();
		return $settings;
	}

	/**
	 * Determines whether the owned settings have changed.
	 *
	 * @since 1.99.0
	 *
	 * @param array $settings     The new settings.
	 * @param array $old_settings The old settings.
	 * @return bool TRUE if owned settings have changed, otherwise FALSE.
	 */
	protected function have_owned_settings_changed( $settings, $old_settings ) {
		$keys = $this->get_owned_keys();

		foreach ( $keys as $key ) {
			if ( isset( $settings[ $key ], $old_settings[ $key ] ) && $settings[ $key ] !== $old_settings[ $key ] ) {
				return true;
			}
		}

		return false;
	}

}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
22 Sep 2026 12.44 AM
docteuh / users
0755
Setting
--
12 Sep 2026 3.36 AM
docteuh / users
0755
Cache.php
3.324 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Encrypted_Options.php
2.374 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Encrypted_User_Options.php
2.829 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Options.php
2.871 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Options_Interface.php
1.326 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Post_Meta.php
2.212 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Post_Meta_Interface.php
1.976 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Post_Meta_Setting.php
3.659 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Setting.php
3.111 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Setting_With_Legacy_Keys_Trait.php
1.036 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Setting_With_Owned_Keys_Interface.php
0.649 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Setting_With_Owned_Keys_Trait.php
2.903 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Setting_With_ViewOnly_Keys_Interface.php
0.673 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
Transients.php
2.074 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
User_Aware_Interface.php
0.801 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
User_Aware_Trait.php
1.422 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
User_Options.php
2.927 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
User_Options_Interface.php
1.342 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
User_Setting.php
3.28 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
User_Transients.php
7.445 KB
6 Dec 2023 8.16 PM
docteuh / users
0644
icon-redirect-manager-20260827192224.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF