AI助手支持GPT4.0
Sometimes for mobile design or more generally small-screen design it can be beneficial to save space by using a dropdown for your navigation.
有时对于移动设计或更普遍的小屏幕设计,使用下拉菜单进行导航可以节省空间。 p>
This plugin provides a way to display your custom menus as dropdowns either using a widget or a function call and can be used as an include in any theme.
此插件提供了一种使用小部件或函数调用将自定义菜单显示为下拉菜单的方法,并且可以用作任何主题中的包含项。 p>
If you are using the plugin with a theme you can use the function dropdown_menu() in place of calls to wp_nav_menu().
dropdown_menu()
wp_nav_menu()
如果您使用具有主题的插件,则可以使用函数 dropdown_menu() code>代替对 wp_nav_menu() code>的调用。 p>The dropdown_menu() function takes the same arguments as wp_nav_menu() with the addition of three extras: dropdown_menu() code>函数采用与 wp_nav_menu() code>相同的参数,并增加了三个附加功能: p> <?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?> code> pre>You can extend and alter the output of the dropdowns using the output filters available in the code.您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
dropdown_menu() code>代替对 wp_nav_menu() code>的调用。 p>The dropdown_menu() function takes the same arguments as wp_nav_menu() with the addition of three extras: dropdown_menu() code>函数采用与 wp_nav_menu() code>相同的参数,并增加了三个附加功能: p> <?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?> code> pre>You can extend and alter the output of the dropdowns using the output filters available in the code.您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
wp_nav_menu() code>的调用。 p>The dropdown_menu() function takes the same arguments as wp_nav_menu() with the addition of three extras: dropdown_menu() code>函数采用与 wp_nav_menu() code>相同的参数,并增加了三个附加功能: p> <?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?> code> pre>You can extend and alter the output of the dropdowns using the output filters available in the code.您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
The dropdown_menu() function takes the same arguments as wp_nav_menu() with the addition of three extras:
dropdown_menu() code>函数采用与 wp_nav_menu() code>相同的参数,并增加了三个附加功能: p> <?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?> code> pre>You can extend and alter the output of the dropdowns using the output filters available in the code.您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
wp_nav_menu() code>相同的参数,并增加了三个附加功能: p> <?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?> code> pre>You can extend and alter the output of the dropdowns using the output filters available in the code.您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?> code> pre>You can extend and alter the output of the dropdowns using the output filters available in the code.您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpdropdown_menu( array( dropdown_menu(数组( // You can alter the blanking text eg.//您可以更改空白文本,例如"- Menu Name -" using the following “-菜单名称-”使用以下内容 'dropdown_title' => '-- Main Menu --', 'dropdown_title'=>'-主菜单-', // indent_string is a string that gets output before the title of a // indent_string是一个字符串,该字符串在a的标题之前输出 // sub-menu item.//子菜单项。It is repeated twice for sub-sub-menu items and so on 子菜单项重复两次,依此类推 'indent_string' => '- ', 'indent_string'=>'-', // indent_after is an optional string to output after the indent_string // indent_after是在indent_string之后输出的可选字符串 // if the item is a sub-menu item //如果该项是子菜单项 'indent_after' => '''indent_after'=>'') );));?>?>
dropdown_menu( array(
dropdown_menu(数组(
// You can alter the blanking text eg.
//您可以更改空白文本,例如
"- Menu Name -" using the following
“-菜单名称-”使用以下内容
'dropdown_title' => '-- Main Menu --',
'dropdown_title'=>'-主菜单-',
// indent_string is a string that gets output before the title of a
// indent_string是一个字符串,该字符串在a的标题之前输出
// sub-menu item.
//子菜单项。
It is repeated twice for sub-sub-menu items and so on
子菜单项重复两次,依此类推
'indent_string' => '- ',
'indent_string'=>'-',
// indent_after is an optional string to output after the indent_string
// indent_after是在indent_string之后输出的可选字符串
// if the item is a sub-menu item
//如果该项是子菜单项
'indent_after' => ''
'indent_after'=>''
) );
));
?>
?>
code> pre>
You can extend and alter the output of the dropdowns using the output filters available in the code.
您可以使用代码中可用的输出过滤器来扩展和更改下拉菜单的输出。 p>
There are also plenty of styling hooks like in the standard list type menus with the addition of classes for targetting items at a certain depth in the menu (.menu-item-depth-1 for example
.menu-item-depth-1
还有很多样式钩子,例如标准列表类型菜单中的样式钩子,以及在菜单中特定深度处定位项目的类(例如 .menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
.menu-item-depth-1 code> ) aswell the usual .current-menu-item and .current-menu-ancestor classes.)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
) aswell the usual .current-menu-item and .current-menu-ancestor classes.
.current-menu-item
.current-menu-ancestor
)以及常用的 .current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
.current-menu-item code>和 .current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
.current-menu-ancestor code>类。 p>Filters/Hooks过滤器/挂钩 h4>dropdown_blank_item_text dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
dropdown_blank_item_text
dropdown_blank_item_text strong> p> <?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?> code> pre>If you want to show the menu title as the blank item text use the follwing code:如果要将菜单标题显示为空白项目文本,请使用以下代码: p> <?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_blank_item_text', 10, 2 );add_filter('dropdown_blank_item_text',10,2);function my_dropdown_blank_text( $title, $args ) { 函数my_dropdown_blank_text($ title,$ args){ return __( '- Browse -' );返回__('-');}}?>?>
add_filter( 'dropdown_blank_item_text', 10, 2 );
add_filter('dropdown_blank_item_text',10,2);
function my_dropdown_blank_text( $title, $args ) {
函数my_dropdown_blank_text($ title,$ args){
return __( '- Browse -' );
返回__('-');
}
If you want to show the menu title as the blank item text use the follwing code:
如果要将菜单标题显示为空白项目文本,请使用以下代码: p>
<?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?> code> pre>dropdown_menus_indent_string dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);function dropdown_menu_use_menu_title( $title, $args ) { 函数dropdown_menu_use_menu_title($ title,$ args){ return '- ' .返回'-'。 $args->menu->name .$ args-> menu-> name。 ' -';'-';}}?>?>
add_filter( 'dropdown_blank_item_text', 'dropdown_menu_use_menu_title', 10, 2 );
add_filter('dropdown_blank_item_text','dropdown_menu_use_menu_title',10,2);
function dropdown_menu_use_menu_title( $title, $args ) {
函数dropdown_menu_use_menu_title($ title,$ args){
return '- ' .
返回'-'。
$args->menu->name .
$ args-> menu-> name。
' -';
'-';
dropdown_menus_indent_string
dropdown_menus_indent_string strong> p> <?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?> code> pre>dropdown_menus_indent_after dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_menus_indent_string', 10, 4 );add_filter('dropdown_menus_indent_string',10,4);function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) { 函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){ return str_repeat( ' ', $depth );return str_repeat('&nbsp;',$ depth);}}?>?>
add_filter( 'dropdown_menus_indent_string', 10, 4 );
add_filter('dropdown_menus_indent_string',10,4);
function my_dropdown_indent_string( $indent_string, $item, $depth, $args ) {
函数my_dropdown_indent_string($ indent_string,$ item,$ depth,$ args){
return str_repeat( ' ', $depth );
return str_repeat('&nbsp;',$ depth);
dropdown_menus_indent_after
dropdown_menus_indent_after strong> p> <?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?> code> pre>dropdown_menus_class dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_menus_indent_after', 10, 4 );add_filter('dropdown_menus_indent_after',10,4);function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) { 函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){ return '-';返回'-';}}?>?>
add_filter( 'dropdown_menus_indent_after', 10, 4 );
add_filter('dropdown_menus_indent_after',10,4);
function my_dropdown_indent_after( $indent_after, $item, $depth, $args ) {
函数my_dropdown_indent_after($ indent_after,$ item,$ depth,$ args){
return '-';
返回'-';
dropdown_menus_class
dropdown_menus_class strong> p>Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p> <?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
Use this if you find you get class name or CSS conflicts, for example with Twitter Bootstrap.
如果发现类名或CSS冲突(例如与Twitter Bootstrap)冲突,请使用此选项。 p>
<?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?> code> pre>dropdown_menus_select_current dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));?>?>
add_filter( 'dropdown_menus_class', create_function( '$c', 'return "my-dropdown-menu-class";' ) );
add_filter('dropdown_menus_class',create_function('$ c','return“ my-dropdown-menu-class”;'));
dropdown_menus_select_current
dropdown_menus_select_current strong> p>Use this filter to stop the output of the selected="selected" attribute.使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
Use this filter to stop the output of the selected="selected" attribute.
selected="selected"
使用此过滤器停止 selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
selected =“ selected” code>属性的输出。Useful if you prefer to show the blank option on every page.如果希望在每个页面上显示空白选项,则很有用。 p> <?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
Useful if you prefer to show the blank option on every page.
如果希望在每个页面上显示空白选项,则很有用。 p>
<?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?> code> pre>Can I make sure this plugin is available to my theme?我可以确保此插件可用于我的主题吗? h4>If your theme requires this plugin to be available it will work as a simple include.如果您的主题要求此插件可用,它将作为简单的include起作用。Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p> <?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpadd_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));?>?>
add_filter( 'dropdown_menus_select_current', create_function( '$bool', 'return false;' ) );
add_filter('dropdown_menus_select_current',create_function('$ bool','return false;'));
If your theme requires this plugin to be available it will work as a simple include.
如果您的主题要求此插件可用,它将作为简单的include起作用。
Just place the plugin into your theme directory and include dropdown-menus.php from your functions.php file.
只需将插件放入您的主题目录,并从functions.php文件中包含dropdown-menus.php。 p>
If you place the plugin folder into your theme’s directory you would use the following code in your functions.php file:
如果将plugin文件夹放置在主题目录中,则可以在functions.php文件中使用以下代码: p>
<?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?> code> pre>
<?phpif ( ! function_exists( 'dropdown_menu' ) ) 如果(!function_exists('dropdown_menu')) include( 'dropdown-menus/dropdown-menus.php' );include('dropdown-menus / dropdown-menus.php');?>?>
if ( ! function_exists( 'dropdown_menu' ) )
如果(!function_exists('dropdown_menu'))
include( 'dropdown-menus/dropdown-menus.php' );
include('dropdown-menus / dropdown-menus.php');
原文出处:http://www.sanshu.cn/a/11600.html
群主管理都是支付大佬