WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

WP_Privacy_Policy_Content::get_suggested_policy_text() public WP 4.9.6

Check for updated, added or removed privacy policy information from plugins.

Caches the current info in post_meta of the policy page.

Это метод класса: WP_Privacy_Policy_Content{}

Хуков нет.

Возвращает

Массив. The privacy policy text/information added by core and plugins.

Использование

$result = WP_Privacy_Policy_Content::get_suggested_policy_text();

Список изменений

С версии 4.9.6 Введена.

Код WP_Privacy_Policy_Content::get_suggested_policy_text() WP 5.5.1

wp-admin/includes/class-wp-privacy-policy-content.php
<?php
public static function get_suggested_policy_text() {
	$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
	$checked        = array();
	$time           = time();
	$update_cache   = false;
	$new            = self::$policy_content;
	$old            = array();

	if ( $policy_page_id ) {
		$old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
	}

	// Check for no-changes and updates.
	foreach ( $new as $new_key => $new_data ) {
		foreach ( $old as $old_key => $old_data ) {
			$found = false;

			if ( $new_data['policy_text'] === $old_data['policy_text'] ) {
				// Use the new plugin name in case it was changed, translated, etc.
				if ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) {
					$old_data['plugin_name'] = $new_data['plugin_name'];
					$update_cache            = true;
				}

				// A plugin was re-activated.
				if ( ! empty( $old_data['removed'] ) ) {
					unset( $old_data['removed'] );
					$old_data['added'] = $time;
					$update_cache      = true;
				}

				$checked[] = $old_data;
				$found     = true;
			} elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {
				// The info for the policy was updated.
				$checked[]    = array(
					'plugin_name' => $new_data['plugin_name'],
					'policy_text' => $new_data['policy_text'],
					'updated'     => $time,
				);
				$found        = true;
				$update_cache = true;
			}

			if ( $found ) {
				unset( $new[ $new_key ], $old[ $old_key ] );
				continue 2;
			}
		}
	}

	if ( ! empty( $new ) ) {
		// A plugin was activated.
		foreach ( $new as $new_data ) {
			if ( ! empty( $new_data['plugin_name'] ) && ! empty( $new_data['policy_text'] ) ) {
				$new_data['added'] = $time;
				$checked[]         = $new_data;
			}
		}
		$update_cache = true;
	}

	if ( ! empty( $old ) ) {
		// A plugin was deactivated.
		foreach ( $old as $old_data ) {
			if ( ! empty( $old_data['plugin_name'] ) && ! empty( $old_data['policy_text'] ) ) {
				$data = array(
					'plugin_name' => $old_data['plugin_name'],
					'policy_text' => $old_data['policy_text'],
					'removed'     => $time,
				);

				$checked[] = $data;
			}
		}
		$update_cache = true;
	}

	if ( $update_cache && $policy_page_id ) {
		delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
		// Update the cache.
		foreach ( $checked as $data ) {
			add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
		}
	}

	return $checked;
}