File "abstract-acf-legacy-location.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/advanced-custom-fields/includes/locations/abstract-acf-legacy-location.php
File size: 1.46 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

if (!defined('ABSPATH')) {
    exit;
}
if (!class_exists('ACF_Legacy_Location')) {
    abstract class ACF_Legacy_Location
    {
        public function __construct()
        {
            if (method_exists($this, 'rule_match')) {
                add_filter("acf/location/rule_match/{$this->name}", array($this, 'rule_match'), 5, 3);
            }
            if (method_exists($this, 'rule_operators')) {
                add_filter("acf/location/rule_operators/{$this->name}", array($this, 'rule_operators'), 5, 2);
            }
            if (method_exists($this, 'rule_values')) {
                add_filter("acf/location/rule_values/{$this->name}", array($this, 'rule_values'), 5, 2);
            }
        }
        public function __call($name, $arguments)
        {
            switch ($name) {
                case 'rule_match':
                    $method = isset($method) ? $method : 'match';
                    $arguments[3] = isset($arguments[3]) ? $arguments[3] : false;
                case 'rule_operators':
                    $method = isset($method) ? $method : 'get_operators';
                case 'rule_values':
                    $method = isset($method) ? $method : 'get_values';
                    array_shift($arguments);
                    return call_user_func_array(array($this, $method), $arguments);
                case 'compare':
                    return call_user_func_array(array($this, 'compare_to_rule'), $arguments);
            }
        }
    }
}