Skip to content

Commit

Permalink
Re-add tags to options-check.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinsays committed Jun 26, 2012
1 parent 2ed9ba6 commit 73fab26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions options-check/index.php
Expand Up @@ -51,6 +51,11 @@
<dd>of_get_option('example_select_categories'): category id = <?php echo of_get_option('example_select_categories', 'no entry' ); ?></dd>
</dl>

<dl>
<dt>type: select</dt>
<dd>of_get_option('example_select_tags'): term id = <?php echo of_get_option('example_select_tags', 'no entry' ); ?></dd>
</dl>

<dl>
<dt>type: select</dt>
<dd>of_get_option('example_select_pages'): page id = <?php echo of_get_option('example_select_pages', 'no entry' ); ?></dd>
Expand Down
14 changes: 14 additions & 0 deletions options-check/options.php
Expand Up @@ -80,6 +80,13 @@ function optionsframework_options() {
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}

// Pull all tags into an array
$options_tags = array();
$options_tags_obj = get_tags();
foreach ( $options_tags_obj as $tag ) {
$options_tags[$tag->term_id] = $tag->name;
}

// Pull all the pages into an array
$options_pages = array();
Expand Down Expand Up @@ -143,6 +150,13 @@ function optionsframework_options() {
'id' => 'example_select_categories',
'type' => 'select',
'options' => $options_categories);

$options[] = array(
'name' => __('Select a Tag', 'options_check'),
'desc' => __('Passed an array of tags with term_id and term_name', 'options_check'),
'id' => 'example_select_tags',
'type' => 'select',
'options' => $options_tags);

$options[] = array(
'name' => __('Select a Page', 'options_check'),
Expand Down

0 comments on commit 73fab26

Please sign in to comment.