initialize(); // Call legacy constructor. parent::__construct(); } /** * Initializes props. * * @date 5/03/2014 * @since 5.0.0 * * @param void * @return void */ public function initialize() { // Set props here. } /** * Returns an array of operators for this location. * * @date 9/4/20 * @since 5.9.0 * * @param array $rule A location rule. * @return array */ public static function get_operators( $rule ) { return array( '==' => __( 'is equal to', 'acf' ), '!=' => __( 'is not equal to', 'acf' ), ); } /** * Returns an array of possible values for this location. * * @date 9/4/20 * @since 5.9.0 * * @param array $rule A location rule. * @return array */ public function get_values( $rule ) { return array(); } /** * Returns the object_type connected to this location. * * @date 1/4/20 * @since 5.9.0 * * @param array $rule A location rule. * @return string */ public function get_object_type( $rule ) { return $this->object_type; } /** * Returns the object_subtype connected to this location. * * @date 1/4/20 * @since 5.9.0 * * @param array $rule A location rule. * @return string|array */ public function get_object_subtype( $rule ) { return $this->object_subtype; } /** * Matches the provided rule against the screen args returning a bool result. * * @date 9/4/20 * @since 5.9.0 * * @param array $rule The location rule. * @param array $screen The screen args. * @param array $field_group The field group settings. * @return bool */ public function match( $rule, $screen, $field_group ) { return false; } /** * Compares the given value and rule params returning true when they match. * * @date 17/9/19 * @since 5.8.1 * * @param array $rule The location rule data. * @param mixed $value The value to compare against. * @return bool */ public function compare_to_rule( $value, $rule ) { $result = ( $value == $rule['value'] ); // Allow "all" to match any value. if ( $rule['value'] === 'all' ) { $result = true; } // Reverse result for "!=" operator. if ( $rule['operator'] === '!=' ) { return ! $result; } return $result; } } endif; // class_exists check