AI助手支持GPT4.0
Ever wanted to be able to automatically have category and pages children automatically added to your menus?
是否曾经希望能够自动将子类别和页面自动添加到菜单中?
I’m sure I did and was disappointed to not find something that dead simple that works and doesn’t mess up with the theme or other plugins.
我确定我确实做到了,并且很失望,没有找到可以正常工作且不会弄乱主题或其他插件的东西。 p>
Now bear with me on this one as it is my first WP plugin for like a decade and the first ever to be shared so i kept it quite basic.
现在就与我同在,因为这是我十年来的第一个WP插件,也是有史以来第一个被共享的插件,因此我保持了相当基本的意思。 p>
How it works:
工作原理: p>
ul>
There is no settings page for the plugin but you can change a couple default behaviours from the code itself
该插件没有设置页面,但是您可以从代码本身更改一些默认行为 p>
$item->automatic_max = 5; $ item-> automatic_max = 5;just change the number at line 220只需更改第220行的数字 code> pre>Bring only direct children of Pages and not all ascendants仅带Pages的直系子孙,而不带所有子孙 h4>$children = get_pages( array( 'child_of' => $item->object_id, 'number' => $item->automatic_max, 'sort_column' => 'post_'.$ordering[0], $ children = get_pages(array('child_of'=> $ item-> object_id,'number'=> $ item-> automatic_max,'sort_column'=>'post _'。$ ordering [0], 'sort_order' => strtoupper( $ordering[1] ) ) );'sort_order'=> strtoupper($ ordering [1])));just change 'child_of' to 'parent' at line 226只需在第226行将“ child_of”更改为“ parent” code> pre>Upcoming Features:即将推出的功能: p>Due to lack of time i will implement the following features upon demand.由于时间不足,我将根据需要实现以下功能。Please post your requests in the forum.请在论坛中发布您的请求。 p>Settings Page设置页面 li>Submenu items ordering子菜单项订购 li>Support for custom post types and taxonomies支持自定义帖子类型和分类法 li> ul>Credits:积分: p>I have used the menu walker created by zviryatko (https://plugins.trac.wordpress.org/browser/menu-image/trunk/menu-image.php)我使用了zviryatko(https://plugins.trac.wordpress.org/browser/menu-image/trunk/menu-image.php)创建的菜单浏览器 li> ul>
$ item-> automatic_max = 5;just change the number at line 220只需更改第220行的数字
just change the number at line 220
只需更改第220行的数字
code> pre>
$children = get_pages( array( 'child_of' => $item->object_id, 'number' => $item->automatic_max, 'sort_column' => 'post_'.$ordering[0], $ children = get_pages(array('child_of'=> $ item-> object_id,'number'=> $ item-> automatic_max,'sort_column'=>'post _'。$ ordering [0], 'sort_order' => strtoupper( $ordering[1] ) ) );'sort_order'=> strtoupper($ ordering [1])));just change 'child_of' to 'parent' at line 226只需在第226行将“ child_of”更改为“ parent” code> pre>Upcoming Features:即将推出的功能: p>Due to lack of time i will implement the following features upon demand.由于时间不足,我将根据需要实现以下功能。Please post your requests in the forum.请在论坛中发布您的请求。 p>Settings Page设置页面 li>Submenu items ordering子菜单项订购 li>Support for custom post types and taxonomies支持自定义帖子类型和分类法 li> ul>Credits:积分: p>I have used the menu walker created by zviryatko (https://plugins.trac.wordpress.org/browser/menu-image/trunk/menu-image.php)我使用了zviryatko(https://plugins.trac.wordpress.org/browser/menu-image/trunk/menu-image.php)创建的菜单浏览器 li> ul>
$ children = get_pages(array('child_of'=> $ item-> object_id,'number'=> $ item-> automatic_max,'sort_column'=>'post _'。$ ordering [0], 'sort_order' => strtoupper( $ordering[1] ) ) );'sort_order'=> strtoupper($ ordering [1])));just change 'child_of' to 'parent' at line 226只需在第226行将“ child_of”更改为“ parent”
'sort_order' => strtoupper( $ordering[1] ) ) );
'sort_order'=> strtoupper($ ordering [1])));
just change 'child_of' to 'parent' at line 226
只需在第226行将“ child_of”更改为“ parent”
Upcoming Features:
即将推出的功能: p>
Due to lack of time i will implement the following features upon demand.
由于时间不足,我将根据需要实现以下功能。
Please post your requests in the forum.
请在论坛中发布您的请求。 p>
Credits:
积分: p>
Plain and simple
简单明了 p>
/wp-content/plugins/
/ wp-content / plugins / code>目录,或直接通过WordPress插件屏幕安装插件。 li>Activate the plugin through the ‘Plugins’ screen in WordPress通过WordPress中的“插件”屏幕激活插件 li>Go to Appearance->Menu and config each menu item as you like转到“外观”->“菜单”并根据需要配置每个菜单项 li>
ol>
原文出处:http://www.sanshu.cn/a/3403.html
群主管理都是支付大佬