Yoast\WP\SEO\Helpers
Short_Link_Helper::collect_additional_shortlink_data
Collects the additional data necessary for the shortlink.
Метод класса: Short_Link_Helper{}
Хуков нет.
Возвращает
Массив. The shortlink data.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->collect_additional_shortlink_data();
Код Short_Link_Helper::collect_additional_shortlink_data() Short Link Helper::collect additional shortlink data Yoast 27.3
protected function collect_additional_shortlink_data() {
$data = [
'php_version' => $this->get_php_version(),
'platform' => 'wordpress',
'platform_version' => $this->get_platform_version(),
'software' => $this->get_software(),
'software_version' => \WPSEO_VERSION,
'days_active' => $this->get_days_active(),
'user_language' => \get_user_locale(),
];
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
if ( isset( $_GET['page'] ) && \is_string( $_GET['page'] ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
$admin_page = \sanitize_text_field( \wp_unslash( $_GET['page'] ) );
if ( ! empty( $admin_page ) ) {
$data['screen'] = $admin_page;
}
}
return $data;
}