Created
February 12, 2012 20:50
-
-
Save shawnsandy/1810791 to your computer and use it in GitHub Desktop.
Admin Quick Jump Edit
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
<?php | |
$jck_posts_recent = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE $wpdb->posts.post_parent = 0 AND $wpdb->posts.post_type = '$posttype' AND $wpdb->posts.post_status = 'publish' ORDER BY ID DESC LIMIT 10"); | |
if ($jck_posts_recent) { | |
$content .= "<optgroup label='Recently' style='color: #ccc; padding: 5px;'>"; | |
foreach ($jck_posts_recent as $jck_post) { | |
$selected = ($jck_post->ID == $post->ID) ? "style='color: #333;padding:3px 0 3px 6px;border-bottom:1px solid #eee;font-weight:bold;' disabled='disabled' selected='selected'" : ''; | |
$content .= "<option value='" . get_edit_post_link($jck_post->ID) . "'" . $selected . ">" . $jck_post->post_title . " (" . $jck_post->ID . ")" . "</option>"; | |
$jck_posts_sub = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE $wpdb->posts.post_parent = '$jck_post->ID' AND $wpdb->posts.post_type = '$posttype' AND $wpdb->posts.post_status = 'publish' ORDER BY post_title ASC"); | |
foreach ($jck_posts_sub as $jck_post_sub) { | |
$selected = ($jck_post_sub->ID == $post->ID) ? "style='color: #333;padding:3px 0 3px 6px;border-bottom:1px solid #eee;font-weight:bold;' disabled='disabled' selected='selected'" : ''; | |
$content .= "<option value='" . get_edit_post_link($jck_post_sub->ID) . "'" . $selected . ">— " . $jck_post_sub->post_title . " (" . $jck_post_sub->ID . ")" . "</option>"; | |
$jck_posts_sub_sub = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE $wpdb->posts.post_parent = '$jck_post_sub->ID' AND $wpdb->posts.post_type = '$posttype' AND $wpdb->posts.post_status = 'publish' ORDER BY post_title ASC"); | |
foreach ($jck_posts_sub_sub as $jck_post_sub_sub) { | |
$selected = ($jck_post_sub_sub->ID == $post->ID) ? "style='color: #333;padding:3px 0 3px 6px;border-bottom:1px solid #eee;font-weight:bold;' disabled='disabled' selected='selected'" : ''; | |
$content .= "<option value='" . get_edit_post_link($jck_post_sub_sub->ID) . "'" . $selected . "> — " . $jck_post_sub_sub->post_title . " (" . $jck_post_sub_sub->ID . ")" . "</option>"; | |
} //$jck_posts_sub_sub as $jck_post_sub_sub | |
} //$jck_posts_sub as $jck_post_sub | |
} //$jck_posts as $jck_post | |
$content .= "</optgroup>"; | |
} //$jck_posts | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment