ACF_To_REST_API_Controller::format_id PHP Méthode

format_id() protected méthode

protected format_id ( $object )
        protected function format_id($object)
        {
            $this->get_id($object);
            switch ($this->type) {
                case 'comment':
                    $this->id = 'comment_' . $this->id;
                    break;
                case 'user':
                    $this->id = 'user_' . $this->id;
                    break;
                case 'term':
                    if ($object instanceof WP_Term) {
                        $taxonomy = $object->taxonomy;
                    } elseif ($object instanceof WP_REST_Request) {
                        $taxonomy = $object->get_param('taxonomy');
                    }
                    $this->id = $taxonomy . '_' . $this->id;
                    break;
                case 'option':
                    $this->id = 'options';
                    break;
            }
            $this->id = apply_filters('acf/rest_api/id', $this->id);
            return $this->id;
        }