is_dev() ) { add_action( 'wp_nav_menu_item_custom_fields_customize_template', [ __CLASS__, 'custom_fields_customize_template' ] ); // add_action( 'customize_controls_print_footer_scripts', [ __CLASS__, 'print_scripts' ] ); } } static function enqueue_admin_script($hook_suffix) { if ($hook_suffix !== 'nav-menus.php') { return; } amem_register_script( 'amem-menus', amem_get_url("amem-menus{$min}.js", 'assets/js'), ['jquery'], AMEM_VERSION, ['in_footer' => true, 'asset_path' => amem_get_path('', 'assets/js')] ); wp_enqueue_script( 'amem-menus' ); } /** * Render fields for each menu item. * * @param int $item_id Item ID. * @param object $item Item object. * @param int $depth Current menu item depth. * @param array $args Additional array of arguments. */ public static function fields( $item_id, $item, $depth, $args ) { $allowed_user_roles = amem_allowed_roles(); wp_nonce_field( 'amem-menu-nonce', 'amem-menu-nonce' ); $filter_users = [ '' => __( 'Everyone', 'advanced-members' ), 'logged_out' => __( 'Logged Out Users', 'advanced-members' ), 'logged_in' => __( 'Logged In Users', 'advanced-members' ), ]; $none_amem = true; $menu_type = false; $roleCSS = (isset($item->filter_users) && $item->filter_users == 'logged_in') ? '' : ' acf-hidden'; // if ( $item->object == 'page' ) { // $menu_type = array_search( $item->object_id, amem()->options->get_core_pages() ); // } ?>
$label ) : ?>
<# _.each( filterRoles, function(value, key, $) {
is_checked = _.some(amemFilterRole, function(f) {
return f == key;
});
checked = (is_checked) ? 'checked="checked"' : '';
#>
<# } ); #>