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

Yoast_License_Manager::catch_post_request() public Yoast 1.0

Check if the license form has been submitted

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

Хуков нет.

Возвращает

Null. Ничего.

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

$Yoast_License_Manager = new Yoast_License_Manager();
$Yoast_License_Manager->catch_post_request();

Код Yoast_License_Manager::catch_post_request() Yoast 15.1.1

<?php
public function catch_post_request() {

	$name = $this->prefix . 'license_key';

	// check if license key was posted and not empty
	if ( ! isset( $_POST[ $name ] ) ) {
		return;
	}

	// run a quick security check
	$nonce_name = $this->prefix . 'license_nonce';

	if ( ! check_admin_referer( $nonce_name, $nonce_name ) ) {
		return;
	}

	// @TODO: check for user cap?

	// get key from posted value
	$license_key = $_POST[ $name ];

	// check if license key doesn't accidentally contain asterisks
	if ( strstr( $license_key, '*' ) === false ) {

		// sanitize key
		$license_key = trim( sanitize_key( $_POST[ $name ] ) );

		// save license key
		$this->set_license_key( $license_key );
	}

	// does user have an activated valid license
	if ( ! $this->license_is_valid() ) {

		// try to auto-activate license
		return $this->activate_license();

	}

	$action_name = $this->prefix . 'license_action';

	// was one of the action buttons clicked?
	if ( isset( $_POST[ $action_name ] ) ) {

		$action = trim( $_POST[ $action_name ] );

		switch ( $action ) {
			case 'activate':
				return $this->activate_license();

			case 'deactivate':
				return $this->deactivate_license();
		}

	}

}