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

---

Kërkoni te shtojca

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

Kjo shtojcë **s’është testuar me 3 hedhjet e rëndësishme të fundit në qarkullim 
të WordPress-it**. Mund të mos e mirëmbajnë më, ose mundet të mos mbulohet më dhe
mund të ketë probleme përputhshmërie, kur përdoret me versione më të freskët të 
WordPress-it.

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

# Sectors – Conditional Templates & Hooks

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

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

 * [Hollësi](https://sq.wordpress.org/plugins/sectors/#description)
 * [Shqyrtime](https://sq.wordpress.org/plugins/sectors/#reviews)
 *  [Instalim](https://sq.wordpress.org/plugins/sectors/#installation)
 * [Zhvillim](https://sq.wordpress.org/plugins/sectors/#developers)

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

## Përshkrim

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

## Foto ekrani

[⌊Actions & Filters without Sectors⌉⌊Actions & Filters without Sectors⌉[

Actions & Filters without Sectors

[⌊Actions & Filters using Sectors⌉⌊Actions & Filters using Sectors⌉[

Actions & Filters using Sectors

## Instalim

 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_

## Shqyrtime

Për këtë shtojcë s’ka shqyrtime.

## Kontribues & Zhvillues

“Sectors – Conditional Templates & Hooks” është software me burim të hapur. Në këtë
shtojcë kanë dhënë ndihmesë personat vijues.

Kontribues

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

[Përkthejeni “Sectors – Conditional Templates & Hooks” në gjuhën tuaj.](https://translate.wordpress.org/projects/wp-plugins/sectors)

### Ju intereson zhvillimi?

[Shfletoni kodin](https://plugins.trac.wordpress.org/browser/sectors/), shkarkoni
[depon SVN](https://plugins.svn.wordpress.org/sectors/), ose pajtohuni përmes [RSS-je](https://plugins.trac.wordpress.org/log/sectors/?limit=100&mode=stop_on_copy&format=rss)
te [regjistri i zhvillimeve](https://plugins.trac.wordpress.org/log/sectors/).

## Regjistër ndryshimesh

#### 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

## Të tjera

 *  Version **1.2**
 *  Përditësuar së fundi më **2 vjet më parë**
 *  Instalime aktive **10+**
 *  Version WordPress-i ** 4.8 ose më i madh **
 *  E provuar deri me **6.6.10**
 *  Version PHP-je ** 5.6 ose më i madh **
 *  Gjuhë
 * [English (US)](https://wordpress.org/plugins/sectors/)
 * Etiketa
 * [actions](https://sq.wordpress.org/plugins/tags/actions/)[filters](https://sq.wordpress.org/plugins/tags/filters/)
   [hooks](https://sq.wordpress.org/plugins/tags/hooks/)
 *  [Pamje e Thelluar](https://sq.wordpress.org/plugins/sectors/advanced/)

## Vlerësime

S’është parashtruar ende ndonjë përshtypje.

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

[Shihni krejt shqyrtimet](https://wordpress.org/support/plugin/sectors/reviews/)

## Kontribues

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

## Asistencë

Keni diçka për të thënë? Ju duhet ndihmë?

 [Shihni forum asistence](https://wordpress.org/support/plugin/sectors/)