I know that, for instance, with a plugin like Advanced Custom Fields, you can add those in there because they are a custom post type. Go to the Jump Menu settings page and look for the Global Content Blocks in the list of post types. If it’s not there, then it can’t be added to the jump menu.
So, turns out GCB are not post types… so I had to write a custom “plugin” plugin for WPJM that will load these into the menu.
I’ll post it within the next 24 hours and update this thread. Cheers!
Hi paulzz3000,
You’ll want to update to 3.3.1 – which I just released. There is now a filter at the beginning and end of the menu <select>… which means you can add <optgroup>s or <options>
I downloaded the Global Content Blocks and set up the filter to display them… this *should* work. Try adding this to your theme’s functions folder, or you could add it as a plugin (if you’re familiar with setting up plugins):
add_action( 'plugins_loaded', 'wpjm_gcb_add_filter' );
if (!function_exists('wpjm_gcb_add_filter'))
{
function wpjm_gcb_add_filter( $wpjm_string )
{
add_filter( 'wpjm-filter-beginning-of-list', 'wpjm_gcb_filter' );
}
}
if (!function_exists('wpjm_gcb_filter'))
{
function wpjm_gcb_filter( $wpjm_string ) {
if (class_exists('gcb'))
{
$entries = gcb::get_entries();
if (!empty($entries))
{
$wpjm_string .= '<optgroup label="Global Content Blocks">';
foreach($entries as $entry) {
$wpjm_string .= '<option value="' . admin_url() . 'options-general.php?page=global-content-blocks&view=update&edid=' . $entry['id'] . '" ' . ( ( isset($_GET['edid']) && ($entry['id'] == $_GET['edid'] ) )?'selected="selected"':'').'>' . $entry['name'] . '</option>';
}
$wpjm_string .= '</optgroup>';
}
}
return $wpjm_string;
}
}
So, notice in there the add_filter
function… the first parameter is wpjm-filter-beginning-of-list
change this to wpjm-filter-end-of-list
if you want the global content blocks to appear at the end of the list.
Unfortunately there’s no way to order them within the custom post types… beginning or end is the best I could do for now.
Cheers.
Excellent stuff. Many thanks!