phpwine/wpmenuwalker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpwine/wpmenuwalker

Composer 安装命令:

composer require phpwine/wpmenuwalker

包简介

For WordPress Custom Menu extending Walker with PHPWine

README 文档

README

 /* Installation */
 composer require phpwine/wpmenuwalker v1.4.1

 /* required version *v2.0 */
 composer require phpwine/optimizedhtml v2.0
 <?php 
 
 // functions.php 
 if ( ! defined( 'WPINC' ) ) { die; }

 // file on the very top 
 use \PHPWineOptimizedHtml\OptimizedHtml;

 /** PHPWine **/
 require_once get_template_directory() . '/vendor/autoload.php';

 $wine = new OptimizedHtml;
 ...
  // Register custom navigation menu
  add_action( 'init', 'nielsoffice_nav_menus' );
  function nielsoffice_nav_menus() {

   $locations = array(
    'main-menu' => __( 'Primary menu', 'nielsoffice' )
   );
   register_nav_menus( $locations );
 }
// namespace
 use \PHPWineWPWalker\WineWPMenuWalker;

// init custom menu 
 wp_nav_menu( array(
   'theme_location'  => 'main-menu',
   'menu_id'         => 'primary-menu',

  'container' 	    => 'nav',
  'container_class' => 'menu-wine',   // %1$s
  'menu_class' 	    => 'wine', // %2$s .... %3$s = list items.
  'add_li_class'    => 'pwine',
  'items_wrap' 	    => '<ul class="p-wine %2$s" id="%1$s">%3$s</ul>',
  'walker' => new WineWPMenuWalker()
  )
);
<nav class="menu-wine">
    <ul class="p-wine wine" id="primary-menu">
        <li id="item_25" class="item-25"><a href="#" class="link-25">Home</a></li>
        <li id="item_24" class="course-title-class">
            <a href="#" class="link-24">Courses</a>
            <ul class="sub_menu"> <!-- first child -->
                <li id="item_27" class="item-27">
                    <a href="#" class="link-27">English</a>
                    <ul class="sub_menu t_child"> <!-- second child -->
                        <li id="item_26" class="item-26"><a href="#" class="link-26">Submit a bug</a></li>
                    </ul>
                </li>
                <li id="item_28" class="item-28"></li>
            </ul>
        </li>
        <li id="item_23" class="item-23"><a href="#" class="link-23">Showcase</a></li>
        <li id="item_22" class="item-22"><a href="#" class="link-22">Blog</a></li>
        <li id="item_21" class="item-21"><a href="#" class="link-21">Buy me coffee?</a></li>
    </ul>
</nav>
 // Hooks sub-menu child parent [ assigned to depth]
 function one_sub_menut_child( $depth, $args ) { /***/ }

 // Hooks Replace Content menu specific item link
 function Courses( $item, $depth, $args, $id ) { /***/ }

 // Hooks Replace Content menu specific item no-link
 function item_24Courses( $item, $depth, $args, $id ) { /***/ }
  
 // Hooks insert element top and bottom from item
 function top_Courses( $item, $depth, $args, $id ) { /***/ }
 function bottom_Courses( $item, $depth, $args, $id ) { /***/ }
// replace link || no-link
function item_27English() {
  return [
   child=> [ 
     [h1, value=>["Hello Wolrd"]]	
   ]	
 ];
}

phpwine/wpmenuwalker 适用场景与选型建议

phpwine/wpmenuwalker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 11 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「phplibrary」 「WP Menu」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 phpwine/wpmenuwalker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 phpwine/wpmenuwalker 我们能提供哪些服务?
定制开发 / 二次开发

基于 phpwine/wpmenuwalker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-24