Created
September 11, 2012 14:11
-
-
Save norcross/3698796 to your computer and use it in GitHub Desktop.
Get pages inside CMB class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 'page_select': | |
echo '<select name="', $field['id'], '" id="', $field['id'], '">'; | |
$linked_items = get_posts(array( | |
'post_type' => array ('page',), | |
'post_status' => 'publish', | |
'posts_per_page' => -1, | |
'orderby' => 'modified', | |
'order' => 'DESC' | |
)); | |
foreach ($linked_items as $linked_item) { | |
echo '<option value="', $linked_item->ID, '"', $meta == $linked_item->ID ? ' selected="selected"' : '', '>', $linked_item->post_title, '</option>'; | |
} | |
echo '</select>'; | |
echo '<p class="cmb_metabox_description">', $field['desc'], '</p>'; | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment