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

WP_Privacy_Policy_Content::privacy_policy_guide() public WP 4.9.6

Output the privacy policy guide together with content from the theme and plugins.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = WP_Privacy_Policy_Content::privacy_policy_guide();

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

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

Код WP_Privacy_Policy_Content::privacy_policy_guide() WP 5.8

<?php
public static function privacy_policy_guide() {

	$content_array = self::get_suggested_policy_text();
	$content       = '';
	$date_format   = __( 'F j, Y' );

	foreach ( $content_array as $section ) {
		$class   = '';
		$meta    = '';
		$removed = '';

		if ( ! empty( $section['removed'] ) ) {
			$badge_class = ' red';
			$date        = date_i18n( $date_format, $section['removed'] );
			/* translators: %s: Date of plugin deactivation. */
			$badge_title = sprintf( __( 'Removed %s.' ), $date );

			/* translators: %s: Date of plugin deactivation. */
			$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
			$removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
		} elseif ( ! empty( $section['updated'] ) ) {
			$badge_class = ' blue';
			$date        = date_i18n( $date_format, $section['updated'] );
			/* translators: %s: Date of privacy policy text update. */
			$badge_title = sprintf( __( 'Updated %s.' ), $date );
		}

		$plugin_name = esc_html( $section['plugin_name'] );

		$sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
		?>
		<h4 class="privacy-settings-accordion-heading">
		<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button">
			<span class="title"><?php echo $plugin_name; ?></span>
			<?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?>
			<span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title; ?></span>
			<?php endif; ?>
			<span class="icon"></span>
		</button>
		</h4>
		<div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
			<?php
			echo $removed;
			echo $section['policy_text'];
			?>
			<?php if ( empty( $section['removed'] ) ) : ?>
			<div class="privacy-settings-accordion-actions">
				<span class="success" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
				<button type="button" class="privacy-text-copy button">
					<span aria-hidden="true"><?php _e( 'Copy suggested policy text to clipboard' ); ?></span>
					<span class="screen-reader-text">
						<?php
						/* translators: %s: Plugin name. */
						printf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
						?>
					</span>
				</button>
			</div>
			<?php endif; ?>
		</div>
		<?php
	}
}