Title: Sectors &#8211; Conditional Templates &amp; Hooks
Author: Joachim Jensen
Published: <strong>5 de febrero de 2018</strong>
Last modified: 28 de julio de 2024

---

Buscar plugins

![](https://ps.w.org/sectors/assets/banner-772x250.png?rev=2064763)

Este plugin **no se ha probado con las últimas 3 versiones mayores de WordPress**.
Puede que ya no tenga soporte ni lo mantenga nadie, o puede que tenga problemas 
de compatibilidad cuando se usa con las versiones más recientes de WordPress.

![](https://ps.w.org/sectors/assets/icon-256x256.png?rev=2064763)

# Sectors – Conditional Templates & Hooks

 Por [Joachim Jensen](https://profiles.wordpress.org/intoxstudio/)

[Descargar](https://downloads.wordpress.org/plugin/sectors.zip)

 * [Detalles](https://es-co.wordpress.org/plugins/sectors/#description)
 * [Valoraciones](https://es-co.wordpress.org/plugins/sectors/#reviews)
 *  [Instalación](https://es-co.wordpress.org/plugins/sectors/#installation)
 * [Desarrollo](https://es-co.wordpress.org/plugins/sectors/#developers)

 [Soporte](https://wordpress.org/support/plugin/sectors/)

## Descripción

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:

 * All posts in a select category
 * Pages by an author
 * Custom Post Types with a Custom Taxonomy
 * …
 * Any combination of above

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:

 * `/sectors/<sector-name>.php`
 * `/sector-<sector-name>.php`

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 )
    ```

## Capturas

 * [[
 * Actions & Filters without Sectors
 * [[
 * Actions & Filters using Sectors

## Instalación

 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_

## Reseñas

No hay reseñas para este plugin.

## Colaboradores y desarrolladores

«Sectors – Conditional Templates & Hooks» es un software de código abierto. Las 
siguientes personas han colaborado con este plugin.

Colaboradores

 *   [ Joachim Jensen ](https://profiles.wordpress.org/intoxstudio/)
 *   [ DEV Institute ](https://profiles.wordpress.org/devinstitute/)

[Traduce «Sectors – Conditional Templates & Hooks» a tu idioma.](https://translate.wordpress.org/projects/wp-plugins/sectors)

### ¿Interesado en el desarrollo?

[Revisa el código](https://plugins.trac.wordpress.org/browser/sectors/) , echa un
vistazo al [repositorio SVN](https://plugins.svn.wordpress.org/sectors/) o suscríbete
al [registro de desarrollo](https://plugins.trac.wordpress.org/log/sectors/) por
[RSS](https://plugins.trac.wordpress.org/log/sectors/?limit=100&mode=stop_on_copy&format=rss).

## Registro de cambios

#### 1.2

 * Added: wordpress 5.5 support
 * Added: minimum wordpress version 4.8
 * Added: minimum php version 5.6
 * Updated: wp-content-aware-engine
 * Updated: wp-db-updater

#### 1.1

 * Added: api to get current sectors
 * Added: ‘sector’ to body class
 * Added: ui improvements
 * Updated: wp-content-aware-engine

#### 1.0

 * Welcome

## Meta

 *  Versión **1.2**
 *  Última actualización **hace 2 años**
 *  Instalaciones activas **10+**
 *  Versión de WordPress ** 4.8 o superior **
 *  Probado hasta **6.6.5**
 *  Versión de PHP ** 5.6 o superior **
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/sectors/)
 * Etiquetas
 * [actions](https://es-co.wordpress.org/plugins/tags/actions/)[filters](https://es-co.wordpress.org/plugins/tags/filters/)
   [hooks](https://es-co.wordpress.org/plugins/tags/hooks/)
 *  [Vista avanzada](https://es-co.wordpress.org/plugins/sectors/advanced/)

## Valoraciones

Aún no se han enviado valoraciones.

[Your review](https://wordpress.org/support/plugin/sectors/reviews/#new-post)

[Ver todos los comentarios](https://wordpress.org/support/plugin/sectors/reviews/)

## Colaboradores

 *   [ Joachim Jensen ](https://profiles.wordpress.org/intoxstudio/)
 *   [ DEV Institute ](https://profiles.wordpress.org/devinstitute/)

## Soporte

¿Tienes algo que decir? ¿Necesitas ayuda?

 [Ver el foro de soporte](https://wordpress.org/support/plugin/sectors/)