function column_name($item)
 {
     $taxonomy_slug = !empty($item['slug']) ? $item['slug'] : ut_taxonomy_name($item['name']);
     echo '<strong> <a href="edit-tags.php?taxonomy=' . $taxonomy_slug . '">' . $item['name'] . '</a> </strong><div class="taxonomy-row-actions"><a href="users.php?page=user-taxonomies&taxonomy=' . $taxonomy_slug . '">' . __('Edit', WP_UT_TRANSLATION_DOMAIN) . '</a> |';
     wp_nonce_field('delete-taxonomy-' . $taxonomy_slug, 'delete-taxonomy-' . $taxonomy_slug);
     echo ' <span class="delete-taxonomy"> <a href="#" id="del-' . $taxonomy_slug . '" data-name="' . $taxonomy_slug . '" title="' . __('Delete Taxonomy', WP_UT_TRANSLATION_DOMAIN) . '">' . __('Trash', WP_UT_TRANSLATION_DOMAIN) . '</a> </span>  </div>';
 }
示例#2
0
    /**
     * User Filter
     */
    function ut_users_filter()
    {
        $ut_taxonomies = get_site_option('ut_taxonomies');
        if (empty($ut_taxonomies) || !is_array($ut_taxonomies)) {
            return;
        }
        foreach ($ut_taxonomies as $ut_taxonomy) {
            extract($ut_taxonomy);
            $taxonomy_slug = !empty($slug) ? $slug : ut_taxonomy_name($name);
            $taxonomy_slug = strlen($taxonomy_slug) > 32 ? substr($taxonomy_slug, 0, 32) : $taxonomy_slug;
            $taxonomy = get_taxonomy($taxonomy_slug);
            if ($taxonomy) {
                ?>
				<label class="screen-reader-text" for="<?php 
                echo $taxonomy_slug;
                ?>
"><?php 
                esc_html_e('Filter by ' . $name, WP_UT_TRANSLATION_DOMAIN);
                ?>
</label>
				<select name="<?php 
                echo $taxonomy_slug;
                ?>
" id="<?php 
                echo $taxonomy_slug;
                ?>
" class="ut-taxonomy-filter">
					<option value=''><?php 
                esc_html_e('Filter by ' . $name, WP_UT_TRANSLATION_DOMAIN);
                ?>
</option>
					<?php 
                $taxonomy_terms = get_terms($taxonomy_slug);
                foreach ($taxonomy_terms as $taxonomy_term) {
                    ?>
						<option value="<?php 
                    echo esc_attr($taxonomy_term->slug);
                    ?>
"<?php 
                    if (isset($_GET[$taxonomy_slug]) && !empty($_GET[$taxonomy_slug]) && $_GET[$taxonomy_slug] == $taxonomy_term->slug) {
                        echo ' selected="selected"';
                    }
                    ?>
><?php 
                    echo $taxonomy_term->name;
                    ?>
</option>
					<?php 
                }
                ?>
				</select>
			<?php 
            }
        }
        submit_button(__('Filter', WP_UT_TRANSLATION_DOMAIN), 'secondary', 'ut-filter-users', false);
        wp_nonce_field('ut-filter-users', 'ut-filter-users-nonce');
        ?>
		<a class="ut-reset-filters button-primary" href="users.php" title="Reset User Filters">Reset Filters</a>
		<?php 
    }