本文整理汇总了PHP中wp_nav_menu_disabled_check函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_nav_menu_disabled_check函数的具体用法?PHP wp_nav_menu_disabled_check怎么用?PHP wp_nav_menu_disabled_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_nav_menu_disabled_check函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cjtheme_admin_do_wp_nav_menu_meta_box
/**
* Build and populate the BuddyPress accordion on Appearance > Menus.
*
* @since cjtheme 1.5.1
*
* @global $nav_menu_selected_id
*/
function cjtheme_admin_do_wp_nav_menu_meta_box()
{
global $nav_menu_selected_id;
$walker = new cjtheme_Walker_Nav_Menu_Checklist(false);
$args = array('walker' => $walker);
$post_type_name = 'cjtheme';
$tabs = array();
$menu_items = array();
$menu_items[] = array('name' => __('title', 'cjtheme'), 'slug' => 'title', 'link' => '#', 'class' => 'title');
$menu_items[] = array('name' => __('Login', 'cjtheme'), 'slug' => 'login', 'link' => '#');
$menu_items[] = array('name' => __('Logout', 'cjtheme'), 'slug' => 'logout', 'link' => wp_logout_url(site_url()));
$menu_items[] = array('name' => __('Register', 'cjtheme'), 'slug' => 'register', 'link' => "#");
$menu_items[] = array('name' => __('Instant Search', 'cjtheme'), 'slug' => 'instant-search', 'link' => "#instant-search");
$menu_items = apply_filters('cjtheme_nav_menu_items', $menu_items);
$page_args = array();
if (!empty($menu_items)) {
foreach ($menu_items as $item) {
$item_name = '';
// Remove <span>number</span>
$item_name = preg_replace('/([.0-9]+)/', '', $item['name']);
$item_name = trim(strip_tags($item_name));
$page_args[$item['slug']] = (object) array('ID' => -1, 'post_title' => $item_name, 'post_author' => 0, 'post_date' => 0, 'post_excerpt' => $item['slug'], 'post_type' => 'page', 'post_status' => 'publish', 'comment_status' => 'closed', 'guid' => $item['link']);
}
} else {
_e('No items available here for the moment', 'cjtheme');
return;
}
$tabs['pages'] = $page_args;
?>
<div id="cjtheme-menu" class="posttypediv">
<div id="tabs-panel-posttype-<?php
echo $post_type_name;
?>
-loggedin" class="tabs-panel tabs-panel-active">
<ul id="cjtheme-menu-checklist-loggedin" class="categorychecklist form-no-clear">
<?php
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $tabs['pages']), 0, (object) $args);
?>
</ul>
</div>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
if (function_exists('wp_nav_menu_disabled_check')) {
wp_nav_menu_disabled_check($nav_menu_selected_id);
}
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu', 'cjtheme');
?>
" name="add-custom-menu-item" id="submit-cjtheme-menu" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /#cjtheme-menu -->
<?php
}
示例2: mynav_show_custom_box
function mynav_show_custom_box()
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$locations = get_nav_menu_locations();
//_print($locations);
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
?>
<div class="customlinkdiv" id="customlinkdiv">
<input type="hidden" value="custom" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type]" />
<p id="menu-item-url-wrap">
<label class="howto" for="custom-menu-item-url">
<span><?php
_e('URL');
?>
</span>
<input id="custom-menu-item-url" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
</label>
</p>
<p id="menu-item-name-wrap">
<label class="howto" for="custom-menu-item-name">
<span><?php
_e('Link Text');
?>
</span>
<input id="custom-menu-item-name" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-title]" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php
esc_attr_e('Menu Item');
?>
" />
</label>
</p>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-custom-menu-item" id="submit-customlinkdiv" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /.customlinkdiv -->
<?php
}
示例3: archives_meta_box
/**
* Archives Menu
*
* @param mixed $object Current object.
* @param array $metabox Box settings.
*/
public static function archives_meta_box($object, $metabox)
{
global $nav_menu_selected_id;
if (empty(static::$post_types)) {
echo '<p>' . __('No items.') . '</p>';
return;
}
$walker = new \Walker_Nav_Menu_Checklist([]);
?>
<div id="<?php
echo static::$obj_archive;
?>
" class="<?php
echo static::$obj_archive;
?>
div">
<div id="tabs-panel-<?php
echo static::$obj_archive;
?>
" class="tabs-panel tabs-panel-active">
<ul id="<?php
echo static::$obj_archive;
?>
-checklist" class="categorychecklist form-no-clear"><?php
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', static::$post_types), 0, (object) ['walker' => $walker]);
?>
</ul>
</div><!-- /.tabs-panel -->
</div>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-<?php
echo static::$obj_archive;
?>
-menu-item" id="submit-<?php
echo static::$obj_archive;
?>
" />
<span class="spinner"></span>
</span>
</p>
<?php
}
示例4: callback
public function callback($params)
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
/* get custom post types with archive support */
$args = array('show_in_nav_menus' => true, 'has_archive' => true);
$post_types = Post_Type::find($args, 'object');
/* hydrate the necessary object properties for the walker */
foreach ($post_types as &$post_type) {
$post_type->classes = array();
$post_type->type = $post_type->name;
$post_type->object_id = $post_type->name;
$post_type->title = $post_type->labels->name . ' ' . __('Archive', 'default');
$post_type->object = 'cpt-archive';
$post_type->menu_item_parent = null;
$post_type->url = null;
$post_type->xfn = null;
$post_type->db_id = null;
$post_type->target = null;
$post_type->attr_title = null;
}
$walker = new \Walker_Nav_Menu_Checklist(array());
?>
<div id="cpt-archive" class="posttypediv">
<div id="tabs-panel-cpt-archive" class="tabs-panel tabs-panel-active">
<ul id="ctp-archive-checklist" class="categorychecklist form-no-clear">
<?php
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $post_types), 0, (object) array('walker' => $walker));
?>
</ul>
</div>
</div>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-ctp-archive-menu-item" id="submit-cpt-archive" />
<span class="spinner"></span>
</span>
</p>
<?php
}
示例5: ee_cpt_archive_pages
public function ee_cpt_archive_pages()
{
global $nav_menu_selected_id;
$db_fields = false;
$walker = new Walker_Nav_Menu_Checklist($db_fields);
$current_tab = 'event-archives';
/*if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
$current_tab = 'search';
}/**/
$removed_args = array('action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce');
?>
<div id="posttype-extra-nav-menu-pages" class="posttypediv">
<ul id="posttype-extra-nav-menu-pages-tabs" class="posttype-tabs add-menu-item-tabs">
<li <?php
echo 'event-archives' == $current_tab ? ' class="tabs"' : '';
?>
>
<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php
if ($nav_menu_selected_id) {
echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args)));
}
?>
#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
<?php
_e('Event Archive Pages', 'event_espresso');
?>
</a>
</li>
<?php
/* // temporarily removing but leaving skeleton in place in case we ever decide to add more tabs.
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all">
<?php _e( 'View All' ); ?>
</a>
</li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-search" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-extra-nav-menu-pages-search">
<?php _e( 'Search'); ?>
</a>
</li> -->
</ul><!-- .posttype-tabs -->
<?php */
?>
<div id="tabs-panel-posttype-extra-nav-menu-pages-event-archives" class="tabs-panel <?php
echo 'event-archives' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive';
?>
">
<ul id="extra-nav-menu-pageschecklist-event-archives" class="categorychecklist form-no-clear">
<?php
$pages = $this->_get_extra_nav_menu_pages_items();
$args['walker'] = $walker;
echo walk_nav_menu_tree(array_map(array($this, '_setup_extra_nav_menu_pages_items'), $pages), 0, (object) $args);
?>
</ul>
</div><!-- /.tabs-panel -->
<p class="button-controls">
<span class="list-controls">
<a href="<?php
echo esc_url(add_query_arg(array('extra-nav-menu-pages-tab' => 'event-archives', 'selectall' => 1), remove_query_arg($removed_args)));
?>
#posttype-extra-nav-menu-pages>" class="select-all"><?php
_e('Select All');
?>
</a>
</span>
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e(__('Add to Menu'));
?>
" name="add-post-type-menu-item" id="<?php
esc_attr_e('submit-posttype-extra-nav-menu-pages');
?>
" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /.posttypediv -->
<?php
}
示例6: wplms_admin_do_wp_nav_menu_meta_box
function wplms_admin_do_wp_nav_menu_meta_box()
{
global $nav_menu_selected_id;
$walker = new WPLMS_backend_menu(false);
$args = array('walker' => $walker);
$post_type_name = 'wplms';
$tabs = array();
$tabs['membersonly']['label'] = __('Members-Only', 'vibe');
$tabs['membersonly']['pages'] = wplms_nav_menu_get_members_pages();
$tabs['instructorsonly']['label'] = __('Instructors-Only', 'vibe');
$tabs['instructorsonly']['pages'] = wplms_nav_menu_get_instructors_pages();
?>
<div id="wplms-menu" class="posttypediv">
<h4><?php
_e('Members-Only', 'vibe');
?>
</h4>
<p><?php
_e('<em>Members-Only</em> These links are only visible to logged in users.', 'vibe');
?>
</p>
<div id="tabs-panel-posttype-<?php
echo $post_type_name;
?>
-loggedin" class="tabs-panel tabs-panel-active">
<ul id="wplms-menu-checklist-loggedin" class="categorychecklist form-no-clear">
<?php
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $tabs['membersonly']['pages']), 0, (object) $args);
?>
</ul>
</div>
<h4><?php
_e('Instructors-Only', 'vibe');
?>
</h4>
<p><?php
_e('<em>Instructors-Only</em> links are visible to Instructors.', 'vibe');
?>
</p>
<div id="tabs-panel-posttype-<?php
echo $post_type_name;
?>
-loggedout" class="tabs-panel tabs-panel-active">
<ul id="buddypress-menu-checklist-loggedout" class="categorychecklist form-no-clear">
<?php
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $tabs['instructorsonly']['pages']), 0, (object) $args);
?>
</ul>
</div>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
if (function_exists('wp_nav_menu_disabled_check')) {
wp_nav_menu_disabled_check($nav_menu_selected_id);
}
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu', 'vibe');
?>
" name="add-custom-menu-item" id="submit-wplms-menu" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /#buddypress-menu -->
<?php
}
示例7: add_megamenu_metabox
function add_megamenu_metabox($post)
{
// Add an nonce field so we can check for it later.
wp_nonce_field('add_megamenu_metabox', 'add_megamenu_metabox_nonce');
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
?>
<div class="customlink-add-item" id="customlink-add-item">
<input type="submit" <?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu" value="<?php
esc_attr_e('Add Column');
?>
" name="add-column" id="submit-megamenu-column" onclick="jQuery('#custom-menu-item-name-megamenu').val('Mega Menu Column') "/><br><br>
<input type="submit" <?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu" value="<?php
esc_attr_e('Add Heading Item');
?>
" name="add-column" id="submit-megamenu-heading-item" onclick="jQuery('#custom-menu-item-name-megamenu').val('Mega Menu Heading') "/><br><br>
<input type="submit" <?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu" value="<?php
esc_attr_e('Add Content Item');
?>
" name="add-column" id="submit-megamenu-content-item" onclick="jQuery('#custom-menu-item-name-megamenu').val('Mega Menu Content') "/><br><br>
<label for="myplugin_new_field">After you click on the button, menu item will appear on the bottom of current menu.<br>
Rearrange it to the right position<br>
<br>
See our documentation on ....
</label>
</div>
<?php
wp_register_style('tfingi-megamenu-backend', plugins_url('tfingi-megamenu-backend.css', __FILE__));
wp_enqueue_style('tfingi-megamenu-backend');
wp_register_script('tfingi-megamenu-js', plugins_url('tfingi-megamenu.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . 'tfingi-megamenu.js'), true);
wp_enqueue_script('tfingi-megamenu-js');
}
示例8: nav_html
//.........这里部分代码省略.........
"> <?php
echo __('CoursePress Login', 'cp');
?>
</label>
<input type="hidden" class="menu-item-type" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type]" value="custom">
<input type="hidden" class="menu-item-title" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-title]" value="<?php
echo __('Login', 'cp');
?>
">
<input type="hidden" class="menu-item-url" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" value="<?php
echo CoursePress::instance()->get_login_slug(true);
?>
">
<input type="hidden" class="menu-item-classes" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-classes]" value="coursepress-menu-item coursepress-menu-item-login">
</li>
<?php
$_nav_menu_placeholder = $_nav_menu_placeholder - 1;
?>
<li>
<label class="menu-item-title">
<input type="checkbox" class="menu-item-checkbox" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-object-id]" value="<?php
echo $_nav_menu_placeholder;
?>
"> <?php
echo __('CoursePress Signup', 'cp');
?>
</label>
<input type="hidden" class="menu-item-type" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type]" value="custom">
<input type="hidden" class="menu-item-title" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-title]" value="<?php
echo __('Signup', 'cp');
?>
">
<input type="hidden" class="menu-item-url" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" value="<?php
echo CoursePress::instance()->get_signup_slug(true);
?>
">
<input type="hidden" class="menu-item-classes" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-classes]" value="coursepress-menu-item coursepress-menu-item-signup">
</li>
</ul>
</div>
<!-- /.tabs-panel -->
<p class="button-controls">
<span class="list-controls">
<a href="<?php
echo esc_url(add_query_arg(array($post_type_name . '-tab' => 'cp-published', 'selectall' => 1), remove_query_arg($removed_args)));
?>
#posttype-<?php
echo $post_type_name;
?>
" class="select-all"><?php
_e('Select All', 'cp');
?>
</a>
</span>
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu', 'cp');
?>
" name="add-course-menu-item" id="<?php
echo esc_attr('submit-posttype-' . $post_type_name);
?>
"/>
<span class="spinner"></span>
</span>
</p>
</div>
<?php
}
示例9: wp_nav_menu_item_anspress_meta_box
/**
* Shows AnsPress menu meta box in WP menu editor
* @return void
* @since unknown
*/
public function wp_nav_menu_item_anspress_meta_box()
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
$pages = anspress()->pages;
echo '<div class="aplinks" id="aplinks">';
echo '<input type="hidden" value="custom" name="menu-item[' . $_nav_menu_placeholder . '][menu-item-type]" />';
echo '<ul>';
$pages['profile'] = array('title' => __('User profile', 'anspress-question-answer'), 'show_in_menu' => true);
$pages['notification'] = array('title' => __('User notification', 'anspress-question-answer'), 'show_in_menu' => true);
foreach ($pages as $k => $args) {
if ($args['show_in_menu']) {
echo '<li>';
echo '<label class="menu-item-title">';
echo '<input type="radio" value="" name="menu-item[' . $_nav_menu_placeholder . '][menu-item-url]" class="menu-item-checkbox" data-url="' . strtoupper('ANSPRESS_PAGE_URL_' . $k) . '" data-title="' . $args['title'] . '"> ' . $args['title'] . '</label>';
echo '</li>';
}
}
echo '</ul><p class="button-controls">
<span class="add-to-menu">
<input type="submit"' . wp_nav_menu_disabled_check($nav_menu_selected_id) . ' class="button-secondary submit-add-to-menu right" value="' . __('Add to Menu', 'anspress-question-answer') . '" name="add-custom-menu-item" id="submit-aplinks" />
<span class="spinner"></span>
</span>
</p>';
echo '</div>';
}
示例10: wp_nav_menu_item_anspress_meta_box
public function wp_nav_menu_item_anspress_meta_box()
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
$base_page = ap_opt('base_page');
?>
<div class="aplinks" id="aplinks">
<input type="hidden" value="custom" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type]" />
<ul>
<li>
<label class="menu-item-title">
<input type="radio" value="" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" class="menu-item-checkbox" data-url="ANSPRESS_BASE_PAGE_URL" data-title="<?php
_e('AnsPress', 'ap');
?>
"> <?php
_e('AnsPress', 'ap');
?>
</label>
</li>
<li>
<label class="menu-item-title">
<input type="radio" value="" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" class="menu-item-checkbox" data-url="ANSPRESS_ASK_PAGE_URL" data-title="<?php
_e('Ask', 'ap');
?>
"> <?php
_e('Ask', 'ap');
?>
</label>
</li>
<li>
<label class="menu-item-title">
<input type="radio" value="" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" class="menu-item-checkbox" data-url="ANSPRESS_CATEGORIES_PAGE_URL" data-title="<?php
_e('Categories', 'ap');
?>
"> <?php
_e('Categories', 'ap');
?>
</label>
</li>
<li>
<label class="menu-item-title">
<input type="radio" value="" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" class="menu-item-checkbox" data-url="ANSPRESS_TAGS_PAGE_URL" data-title="<?php
_e('Tags', 'ap');
?>
"> <?php
_e('Tags', 'ap');
?>
</label>
</li>
<li>
<label class="menu-item-title">
<input type="radio" value="" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" class="menu-item-checkbox" data-url="ANSPRESS_USERS_PAGE_URL" data-title="<?php
_e('Users', 'ap');
?>
"> <?php
_e('Users', 'ap');
?>
</label>
</li>
</ul>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-custom-menu-item" id="submit-aplinks" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /.customlinkdiv -->
<?php
}
示例11: search_meta_box_render
function search_meta_box_render()
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
?>
<div class="customlinkdiv" id="searchboxitemdiv">
<div class="tabs-panel-active">
<ul class="categorychecklist">
<li>
<input type="hidden" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type]" value="search">
<input type="hidden" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type_label]" value="<?php
echo _x('Search Box', 'type-label', 'bop-nav-search-box-item');
?>
">
<input type="hidden" class="menu-item-title" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-title]" value="<?php
echo _x('Search', 'default-title', 'bop-nav-search-box-item');
?>
">
<input type="hidden" class="menu-item-url" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-url]" value="<?php
echo esc_attr(get_search_link());
?>
">
<input type="hidden" class="menu-item-classes" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-classes]" value="bop-nav-search">
<input type="checkbox" class="menu-item-object-id" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-object-id]" value="<?php
echo $_nav_menu_placeholder;
?>
" checked="true">
</li>
</ul>
</div>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary right" value="<?php
echo esc_attr_x('Add to menu', 'meta-box-submit', 'bop-nav-search-box-item');
?>
" name="add-search-menu-item" id="submit-searchboxitemdiv">
<span class="spinner"></span>
</span>
</p>
</div>
<script type="text/javascript">
(function($){
$(window).on('load', function(){
$('#submit-searchboxitemdiv').on('click', function(e){
e.preventDefault();
$('#searchboxitemdiv').addSelectedToMenu();
});
});
})(jQuery);
</script>
<?php
}
示例12: kleo_admin_do_wp_nav_menu_meta_box
/**
* Build and populate the BuddyPress accordion on Appearance > Menus.
*
* @since Kleo 1.5.1
*
* @global $nav_menu_selected_id
*/
function kleo_admin_do_wp_nav_menu_meta_box()
{
global $nav_menu_selected_id;
$walker = new Kleo_Walker_Nav_Menu_Checklist(false);
$args = array('walker' => $walker);
$post_type_name = 'kleo';
$tabs = array();
$menu_items = array();
$menu_items[] = array('name' => __('Login', 'kleo_framework'), 'slug' => 'login', 'link' => '#');
$menu_items[] = array('name' => __('Logout', 'kleo_framework'), 'slug' => 'logout', 'link' => "#");
$menu_items[] = array('name' => __('Register', 'kleo_framework'), 'slug' => 'register', 'link' => "#");
$menu_items = apply_filters('kleo_nav_menu_items', $menu_items);
$page_args = array();
if (!empty($menu_items)) {
foreach ($menu_items as $item) {
$item_name = '';
// Remove <span>number</span>
$item_name = preg_replace('/([.0-9]+)/', '', $item['name']);
$item_name = trim(strip_tags($item_name));
$page_args[$item['slug']] = (object) array('ID' => -1, 'post_title' => $item_name, 'post_author' => 0, 'post_date' => 0, 'post_excerpt' => $item['slug'], 'post_type' => 'page', 'post_status' => 'publish', 'comment_status' => 'closed', 'guid' => $item['link']);
}
} else {
_e('No items available here for the moment', 'kleo_framework');
return;
}
$tabs['pages'] = $page_args;
?>
<div id="kleo-menu" class="posttypediv">
<p><?php
_e('Some links are relative to the current user, and are not visible to visitors who are not logged in.', 'kleo_framework');
?>
</p>
<div id="tabs-panel-posttype-<?php
echo $post_type_name;
?>
-loggedin" class="tabs-panel tabs-panel-active">
<ul id="kleo-menu-checklist-loggedin" class="categorychecklist form-no-clear">
<?php
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $tabs['pages']), 0, (object) $args);
?>
</ul>
</div>
<p>With BuddyPress/bbPress installed you can add a link to your profile with ##profile_link## in the URL input from <strong>Links</strong> section bellow. Example: ##profile_link##/messages</p>
<p>You can also include the members username next to the My Account avatar with ##member_name## in the Title Attribute field.</p>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
if (function_exists('wp_nav_menu_disabled_check')) {
wp_nav_menu_disabled_check($nav_menu_selected_id);
}
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu', 'kleo_framework');
?>
" name="add-custom-menu-item" id="submit-kleo-menu" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /#kleo-menu -->
<?php
}
示例13: meta_box
/**
* Display our custom meta box
* @global int $_nav_menu_placeholder A placeholder index for the menu item
* @global int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu
*/
public function meta_box()
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
$last_object_id = get_option('gs_sim_last_object_id', 0);
$object_id = $this->new_object_id($last_object_id);
?>
<div class="gs-sim-div" id="gs-sim-div">
<input type="hidden" class="menu-item-db-id" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-db-id]" value="0" />
<input type="hidden" class="menu-item-object-id" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-object-id]" value="<?php
echo $object_id;
?>
" />
<input type="hidden" class="menu-item-object" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-object]" value="gs_sim" />
<input type="hidden" class="menu-item-type" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-type]" value="gs_sim" />
<input type="hidden" id="gs-sim-description-nonce" value="<?php
echo wp_create_nonce('gs-sim-description-nonce');
?>
" />
<p id="menu-item-title-wrap">
<label for="gs-sim-title"><?php
_e('Title');
?>
</label>
<input id="gs-sim-title" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-title]" type="text" class="regular-text menu-item-textbox" title="<?php
esc_attr_e('Title');
?>
" style="width:100%" />
</p>
<p id="menu-item-html-wrap">
<textarea style="width:100%;" rows="9" id="gs-sim-html" name="menu-item[<?php
echo $_nav_menu_placeholder;
?>
][menu-item-description]" class="code menu-item-textbox" title="<?php
esc_attr_e('Text/html/shortcode here!');
?>
"></textarea>
</p>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-gs-sim-menu-item" id="submit-gs-sim" />
<span class="spinner"></span>
</span>
</p>
</div>
<?php
}
示例14: vpt_render_menu_metabox
function vpt_render_menu_metabox($object, $args)
{
global $_nav_menu_placeholder, $nav_menu_selected_id;
$_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
?>
<div class="customlinkdivVpt" id="customlinkdivVpt">
<input type="hidden" value="custom" name="vpt-menu-item[<?php
echo $_nav_menu_placeholder;
?>
][vpt-menu-item-type]" />
<input id="custom-vpt-menu-item-url" name="vpt-menu-item[<?php
echo $_nav_menu_placeholder;
?>
][vpt-menu-item-url]" type="hidden" value="*" />
<input id="custom-vpt-menu-item-custom-type" name="vpt-menu-item[<?php
echo $_nav_menu_placeholder;
?>
][vpt-menu-item-custom-type]" type="hidden" />
<p id="menu-item-name-wrap">
<label class="howto" for="custom-vpt-menu-item-titles">
<span><?php
_e('Titles');
?>
</span>
<textarea rows="8" id="custom-vpt-menu-item-titles" name="vpt-menu-item[<?php
echo $_nav_menu_placeholder;
?>
][vpt-menu-item-titles]" class="regular-text vpt-menu-item-textbox input-with-default-title" title="<?php
esc_attr_e('Titles');
?>
" style = "margin-left:40px;width:180px;">
</textarea>
<span>* separate Titles using a new line.</span>
</label>
</p>
<p class="button-controls">
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-custom-vpt-menu-item" id="submit-customlinkdivVpt" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /.customlinkdivVpt -->
<?php
}
示例15: wp_nav_menu_item_taxonomy_meta_box
//.........这里部分代码省略.........
<div class="tabs-panel <?php
echo 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive';
?>
" id="tabs-panel-search-taxonomy-<?php
echo $taxonomy_name;
?>
">
<?php
if (isset($_REQUEST['quick-search-taxonomy-' . $taxonomy_name])) {
$searched = esc_attr($_REQUEST['quick-search-taxonomy-' . $taxonomy_name]);
$search_results = get_terms($taxonomy_name, array('name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false));
} else {
$searched = '';
$search_results = array();
}
?>
<p class="quick-search-wrap">
<input type="search" class="quick-search input-with-default-title" title="<?php
esc_attr_e('Search');
?>
" value="<?php
echo $searched;
?>
" name="quick-search-taxonomy-<?php
echo $taxonomy_name;
?>
" />
<span class="spinner"></span>
<?php
submit_button(__('Search'), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array('id' => 'submit-quick-search-taxonomy-' . $taxonomy_name));
?>
</p>
<ul id="<?php
echo $taxonomy_name;
?>
-search-checklist" data-wp-lists="list:<?php
echo $taxonomy_name;
?>
" class="categorychecklist form-no-clear">
<?php
if (!empty($search_results) && !is_wp_error($search_results)) {
?>
<?php
$args['walker'] = $walker;
echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args);
?>
<?php
} elseif (is_wp_error($search_results)) {
?>
<li><?php
echo $search_results->get_error_message();
?>
</li>
<?php
} elseif (!empty($searched)) {
?>
<li><?php
_e('No results found.');
?>
</li>
<?php
}
?>
</ul>
</div><!-- /.tabs-panel -->
<p class="button-controls">
<span class="list-controls">
<a href="<?php
echo esc_url(add_query_arg(array($taxonomy_name . '-tab' => 'all', 'selectall' => 1), remove_query_arg($removed_args)));
?>
#taxonomy-<?php
echo $taxonomy_name;
?>
" class="select-all"><?php
_e('Select All');
?>
</a>
</span>
<span class="add-to-menu">
<input type="submit"<?php
wp_nav_menu_disabled_check($nav_menu_selected_id);
?>
class="button-secondary submit-add-to-menu right" value="<?php
esc_attr_e('Add to Menu');
?>
" name="add-taxonomy-menu-item" id="<?php
echo esc_attr('submit-taxonomy-' . $taxonomy_name);
?>
" />
<span class="spinner"></span>
</span>
</p>
</div><!-- /.taxonomydiv -->
<?php
}