定制 pressgang-wp/pressgang 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pressgang-wp/pressgang

Composer 安装命令:

composer require pressgang-wp/pressgang

包简介

Package for the WordPress PressGang parent theme framework

README 文档

README

PressGang

Hijacking Your WordPress Development Workflow

Ahoy there! Modernize your WordPress development and ship your WordPress themes faster than ever. PressGang anchors your workflow in modern development practices. Build cleaner, faster, smarter themes and navigate your development course to calmer seas.

📖 Read the full documentation at docs.pressgang.dev

Overview

PressGang is a WordPress parent theme framework that gives you the architecture of a modern PHP application — Composer autoloading, Twig templating via Timber, config-driven bootstrapping, and a clear separation of concerns — without leaving the WordPress ecosystem. Build child themes on a solid, opinionated foundation and spend your time on features, not plumbing.

✨ Key Features

  • 🚀 Rapid Development — A solid foundation and conventions that accelerate theme development with clean, modern PHP.
  • 🌲 Timber + Twig — Built on Timber to separate template markup from PHP logic through the Twig templating engine.
  • 🎮 Controller Architecture — MVC-inspired controllers act as view models, preparing context for templates with a clear separation of concerns.
  • Convention over Configuration — Inspired by frameworks like Laravel, repetitive WordPress tasks are bootstrapped via declarative config files — less boilerplate, more building.
  • 📦 Composer & PSR-4 — Dependency management via Composer and PSR-4 autoloading for a consistent, modern codebase.
  • 🔧 Flexible by Design — Keeps the core WordPress structure intact. Leverage everything you already know while gaining powerful tools and conventions.

🧭 Core Concepts

⚙️ Config-Driven Bootstrapping

Everything in PressGang starts with a config file. Arrays in config/ declare what gets registered — post types, taxonomies, sidebars, blocks, scripts, styles, and more. Each config file maps to a class in src/Configuration/ by convention (e.g. config/sidebars.phpSidebars). No queries, no side effects — just declarative registration.

🎮 Controllers

Controllers live in src/Controllers/ and are view models, not request handlers. Each controller extends AbstractController, gathers data via Timber, builds a context array, and selects a template. They must be side-effect free — no writes, no remote requests, no direct rendering.

🌍 Context Managers

Context managers enrich the global Timber::context() with data needed across many templates — menus, site info, theme mods, ACF option pages. They implement ContextManagerInterface, are registered via config/context-managers.php, and must be safe to run on every request (frontend, admin, AJAX, CLI).

🧩 Twig Extensions

All custom Twig functions, filters, and globals are registered through extension managers configured in config/twig-extensions.php. Twig remains a presentation-only layer — no database queries, no mutations, no business logic.

Timber Twig environment options (including compilation cache) are configured through config/timber.php, allowing child themes to opt in per project.

🧱 Blocks & Snippets

Gutenberg blocks are declared in config/blocks.php and live under blocks/<block-name>/ with a block.json and Twig template. Snippets are reusable view partials registered via config/snippets.php — self-contained, explicitly parameterised UI components.

📋 Requirements

  • PHP 8.3+
  • WordPress 6.4+
    • For PHP 8.5 runtime support, use WordPress 6.9+
  • Timber 2.0+
  • Composer

🚀 Getting Started

PressGang is a WordPress parent theme that acts as a framework for your child theme.

Quick Start with PressGang-Child

The fastest way to weigh anchor is with the pressgang-child starter repo:

git clone https://github.com/pressgang-wp/pressgang-child your-theme-name
cd your-theme-name
composer install

Then follow the instructions in that repo's README to configure your child theme.

Manual Setup

  1. Clone PressGang into your wp-content/themes/ directory:

    git clone https://github.com/pressgang-wp/pressgang
  2. Create your own child theme that extends PressGang.

Composer Installation

Require PressGang as a dependency in your child theme:

composer require pressgang-wp/pressgang

🧪 Testing

composer install          # install dev dependencies
composer test             # run the unit test suite
composer test:compat      # run tests with strict PHP error reporting

Tests use PHPUnit + BrainMonkey — no WordPress installation required. See the Testing docs for details on writing new tests.

📖 Documentation

Uncover the buried treasure at: docs.pressgang.dev

📄 License

PressGang is open-sourced software licensed under the MIT license.

pressgang-wp/pressgang 适用场景与选型建议

pressgang-wp/pressgang 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.09k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 pressgang-wp/pressgang 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-22