function attributes_page()
 {
     if (class_exists('STAttribute')) {
         $a = new STAttribute();
         echo balanceTags($a->content());
     }
 }
Example #2
0
_e('Slug', ST_TEXTDOMAIN);
?>
</th>
                        <th scope="col"><?php 
_e('Hierarchical', ST_TEXTDOMAIN);
?>
</th>
                        <th scope="col" colspan="2"><?php 
_e('Post Types', ST_TEXTDOMAIN);
?>
</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
$attribute = new STAttribute();
$attribute_taxonomies = $attribute->get_attributes();
if ($attribute_taxonomies and !empty($attribute_taxonomies)) {
    foreach ($attribute_taxonomies as $tax => $value) {
        ?>
<tr>

                            <td><a href="edit-tags.php?taxonomy=<?php 
        echo esc_html($tax);
        ?>
"><?php 
        echo esc_html($value['name']);
        ?>
</a>

                                <div class="row-actions"><span class="edit"><a href="<?php 
                $tax = $_GET['edit'];
                $all = $this->get_attributes();
                if (isset($all[$tax])) {
                    $all[$tax]['tax'] = $tax;
                    return $this->load_view('attributes/edit', false, array('row' => $all[$tax]));
                } else {
                    wp_safe_redirect(admin_url('admin.php?page=hotel_attributes'));
                    die;
                }
            }
            return $this->load_view('attributes/index');
        }
        function find_attribute($attr, $return_type = 'bool')
        {
            $all = $this->get_attributes();
            switch ($return_type) {
                case "bool":
                    if (isset($all[$attr])) {
                        return true;
                    }
                    return false;
                    break;
                case "array":
                    return isset($all[$attr]) ? $all[$attr] : array();
                    break;
            }
        }
    }
    $a = new STAttribute();
    $a->init();
}