Title: Sectors &#8211; Conditional Templates &amp; Hooks
Author: Joachim Jensen
Published: <strong>فروری 5, 2018</strong>
Last modified: جولائی 28, 2024

---

پلگ انز تلاش کریں

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

یہ پلگ ان **ورڈپریس کے تازہ ترین 3 ریلیزوں کے ساتھ ٹیسٹ نہیں کیا گیا ہے**۔ اب یہ
برقرار نہیں رکھا جا سکتا یا معاونت نہیں کی جا سکتی اور اس کو ورڈپریس کے تازہ ترین
ورژنز کے ساتھ استعمال کیے جانے پر مطابقت کے مسائل ہو سکتے ہیں۔

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

# Sectors – Conditional Templates & Hooks

 منجانب [Joachim Jensen](https://profiles.wordpress.org/intoxstudio/)

[ڈاؤن لوڈ کریں](https://downloads.wordpress.org/plugin/sectors.zip)

 * [تفصیلات](https://ur.wordpress.org/plugins/sectors/#description)
 * [جائزے](https://ur.wordpress.org/plugins/sectors/#reviews)
 *  [انسٹالیشن](https://ur.wordpress.org/plugins/sectors/#installation)
 * [ڈیولپمنٹ](https://ur.wordpress.org/plugins/sectors/#developers)

 [معاونت](https://wordpress.org/support/plugin/sectors/)

## تفصیل

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

## اسکرین شاٹس

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

## انسٹالیشن

 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_

## جائزے

There are no reviews for this plugin.

## شراکت دار اور ڈیویلپرز

“Sectors – Conditional Templates & Hooks” اوپن سورس سافٹ ویئر ہے۔ مندرجہ ذیل لوگوں
نے اس پلگ ان میں حصہ لیا:

شراکت دار

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

[“Sectors – Conditional Templates & Hooks” کا اپنی زبان میں ترجمہ کریں۔](https://translate.wordpress.org/projects/wp-plugins/sectors)

### ڈویلپمینٹ میں دلچسپی ہے؟

[کوڈ براؤز کریں](https://plugins.trac.wordpress.org/browser/sectors/)، [ایس این وی ریپوزیٹری](https://plugins.svn.wordpress.org/sectors/)
کو چیک کریں یا [ڈویلپمینٹ لاگ](https://plugins.trac.wordpress.org/log/sectors/) 
کو سبسکرائب کریں بذریعہ [آر ایس ایس](https://plugins.trac.wordpress.org/log/sectors/?limit=100&mode=stop_on_copy&format=rss)۔

## چینج لاگ

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

## میٹا

 *  Version **1.2**
 *  Last updated **2 سال پہلے**
 *  Active installations **10+**
 *  WordPress version ** 4.8 یا اس سے جدید **
 *  Tested up to **6.6.5**
 *  PHP version ** 5.6 یا اس سے جدید **
 *  Language
 * [English (US)](https://wordpress.org/plugins/sectors/)
 * Tags
 * [actions](https://ur.wordpress.org/plugins/tags/actions/)[filters](https://ur.wordpress.org/plugins/tags/filters/)
   [hooks](https://ur.wordpress.org/plugins/tags/hooks/)
 *  [اعلی درجے کا منظر](https://ur.wordpress.org/plugins/sectors/advanced/)

## درجہ بندیاں

No reviews have been submitted yet.

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

[See all reviews](https://wordpress.org/support/plugin/sectors/reviews/)

## شراکت دار

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

## معاونت

کچھ کہنا ہے؟ مدد چاہیے؟

 [معاونتی فورم دیکھیں](https://wordpress.org/support/plugin/sectors/)