我正在尝试学习一些新东西,但我坚持一些简单的事情。 我设法使用此代码操作wp菜单中的链接
An invalid option was specified. The help for this command
is available below.
Usage: vagrant docker-run [command...]
Options:
--[no-]detach Run in the background
-t, --[no-]tty Allocate a pty
-r, --[no-]rm, Remove container after execution
-h, --help Print this help
但是我需要将这个模式与登录用户的“if”属性一起使用,我无法想象如何。 我要使用的这个模态的代码来自一个按钮
add_filter( 'nav_menu_link_attributes', 'menu_item_data_toggle', 10, 2 );
function menu_item_data_toggle( $atts, $item) {
// Manipulate attributes
if ( 74 == $item -> ID )
$atts['data-toggle'] = 'modal';
return $atts;
}
你可以请我给我一个提示,并将这个菜单链接与这个模态属性一起使用吗? 谢谢!