true
));
foreach ($post_types as $post_type) {
add_meta_box('jump_to', 'Jump to:', array(
&$this,
'jump_to'
), $post_type, 'side', 'high');
} //$post_types as $post_type
add_meta_box('jump_to', 'Jump to:', array(
&$this,
'jump_to'
), 'post', 'side', 'high');
}
function list_posts()
{
global $wpdb;
global $post;
$content = '';
$posttype = $post->post_type;
$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 .= "";
} //$jck_posts
$jck_posts = $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 post_title ASC LIMIT 10 ");
if ($jck_posts) {
$content .= "";
} //$jck_posts
$jck_posts = $wpdb->get_results("
SELECT ID, post_title
FROM $wpdb->posts
WHERE $wpdb->posts.post_type = '$posttype'
AND $wpdb->posts.post_status = 'draft'
ORDER BY post_title ASC
");
if ($jck_posts) {
$content .= "";
} //$jck_posts
return $content;
}
function jump_to()
{
$content = "";
echo $content;
}
function js()
{
wp_enqueue_script('jquery-selectbox', plugins_url('admin-quick-jump/js/jquery.selectbox-0.1.3.min.js'), array(
'jquery'
));
wp_enqueue_script('jquery-functions', plugins_url('admin-quick-jump/js/quickjump.js'), array(
'jquery-selectbox'
));
}
function styles()
{
$myStyleUrl = plugins_url('css/style.css', __FILE__); // Respects SSL, Style.css is relative to the current file
$myStyleFile = WP_PLUGIN_DIR . '/admin-quick-jump/css/style.css';
if (file_exists($myStyleFile)) {
wp_register_style('myStyleSheets', $myStyleUrl);
wp_enqueue_style('myStyleSheets');
} //file_exists($myStyleFile)
}
/** =======================================
* PHP 4 Compatible Constructor
*/
function jck_aqj()
{
$this->__construct();
}
/**
* PHP 5 Constructor
*/
function __construct()
{
add_action('admin_print_styles', array(
&$this,
'styles'
));
add_action('admin_print_scripts', array(
&$this,
'js'
));
add_action('add_meta_boxes', array(
&$this,
'metaboxes'
));
}
} // End jck_aqj Class
$jck_aqj = new jck_aqj; // Start an instance of the plugin class