hard-g/buddypress-12.0-url-polyfills 问题修复 & 功能扩展

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

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

hard-g/buddypress-12.0-url-polyfills

最新稳定版本:1.0.2

Composer 安装命令:

composer require hard-g/buddypress-12.0-url-polyfills

包简介

Polyfills for URL-related functions introduced in BuddyPress 12.0.

README 文档

README

In version 12.0, BuddyPress changed the way that its URLs are built and routed. Previously, URLs were built using a combination of WordPress page routing (the "bp_pages" system for top-level components), PHP constants, and hardcoded strings. After version 12.0, all URLs run through WP's rewrite API.

To accommodate this breaking change, new functions were introduced in BP 12.0 to build URLs. For example, where previously you might have used bp_get_group_permalink( $group_id ), you now use bp_get_group_url( $group_id ).

The BuddyPress 12.0 URL Polyfills library allows developers to build BuddyPress plugins that are compatible with both the new and old URL systems. Developers should write code that uses the new URL functions, such as bp_get_group_url(). Then, if the plugin is loaded on a site running a version of BuddyPress prior to 12.0, this library will provide the necessary polyfills so that your plugin runs as expected. Similarly, developers updating their existing BuddyPress plugins for BP 12.0 compatibility can update their code to use the new URL functions exclusively, and then use this library to provide backwards compatibility for older versions of BuddyPress.

Installation

This library is available on Packagist. To install it, run:

$ composer require hard-g/buddypress-12.0-url-polyfills 

Alternatively, you may download the library and install it manually.

Usage

In your plugin or theme, require the autoloader, and then load the polyfill library as follows:

require_once __DIR__ . '/vendor/autoload.php'; HardG\BuddyPress120URLPolyfills\Loader::init();

The polyfill library loads its files on the 'bp_include' hook. For this reason, it's important that you invoke the library (using the Loader::init() method shown above) early in your plugin bootstrap.

Help!

This library has been built as part of my own efforts to upgrade my many BuddyPress plugins for BP 12.0. As such, it includes polyfills for those functions that I've identified as necessary for my own plugins. If you find more functions that need polyfills, please open a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固