'array', 'items' => array( 'type' => 'string' ), ); } /** * Gets the default value for a newly created condition of this type. * * @return mixed */ public function default_value() { return array(); } /** * Evaluates the condition against the given context. * * @param Context $context Request context value object. * @param string $operator Operator identifier. * @param mixed $value Configured value. * @return bool */ public function evaluate( Context $context, string $operator, $value ): bool { $types = $this->string_list( $value ); $current = $context->post_type; if ( null === $current ) { return 'is_not' === $operator; // No post type: 'is' = false, 'is_not' = true. } $match = in_array( $current, $types, true ); return 'is_not' === $operator ? ! $match : $match; } }