Linux 软件免费装
Banner图

Sectors - Conditional Templates & Hooks

开发者 intoxstudio
devinstitute
更新时间 2024年7月28日 15:14
PHP版本: 5.6 及以上
WordPress版本: 6.6
版权: GPLv3

标签

filters actions hooks conditional templates

下载

详情介绍:

Sectors is a first of its kind plugin for WordPress. Create theme templates for any context on your site. Make sure select Actions or Filters are only added when certain conditions are met. Contexts When you add a new sector to your site, you select the content it covers. This could be: Sectors also comes with built in support for BuddyPress, WPML, Polylang, and more. Templates Sectors will look in your theme folder for the following templates: If found, it will be automatically loaded for the context. API Template Tags Check if a query is part of a given or any sector: is_sector(string $sector):boolean Get all sectors for current context: get_current_sectors():array Hooks Sectors extends all WordPress Actions and Filters by adding a scope. This means you can add a callback to an action and make sure it's only executed in a given context: `add_sector_action(string $sector, string $tag, callable $function, int $priority = 10, int $accepted_args = 1 ) add_sector_filter(string $sector, string $tag, callable $function, int $priority = 10, int $accepted_args = 1 )`

安装:

  1. Upload the full plugin directory to your /wp-content/plugins/ directory or install the plugin through Plugins in the Admin Dashboard
  2. Activate the plugin through Plugins in the Admin Dashboard
  3. Create your first Sector under the menu Sectors > Add New

屏幕截图:

  • Actions & Filters using Sectors

更新日志:

1.2 1.1 1.0