Yoast\WP\SEO\Conditionals

Get_Request_Conditional{}Yoast 1.0

Conditional that is only met when the current request uses the GET method.

Хуков нет.

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

$Get_Request_Conditional = new Get_Request_Conditional();
// use class methods

Методы

  1. public is_met()

Код Get_Request_Conditional{} Yoast 22.4

class Get_Request_Conditional implements Conditional {

	/**
	 * Returns whether or not this conditional is met.
	 *
	 * @return bool Whether or not the conditional is met.
	 */
	public function is_met() {
		if ( isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] === 'GET' ) {
			return true;
		}

		return false;
	}
}