WPSEO_MyYoast_Proxy::get_plugin_version()protectedYoast 1.0

Returns the plugin version from the HTTP request parameters.

Метод класса: WPSEO_MyYoast_Proxy{}

Хуков нет.

Возвращает

Строку. The sanitized plugin_version request parameter or an empty string if it does not exist.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_plugin_version();

Код WPSEO_MyYoast_Proxy::get_plugin_version() Yoast 22.4

protected function get_plugin_version() {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
	if ( isset( $_GET['plugin_version'] ) && is_string( $_GET['plugin_version'] ) ) {
		// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
		$plugin_version = sanitize_text_field( wp_unslash( $_GET['plugin_version'] ) );
		// Replace slashes to secure against requiring a file from another path.
		return str_replace( [ '/', '\\' ], '_', $plugin_version );
	}
	return '';
}