Title: IF AS Shortcode
Author: Mohammad I. Okfie
Published: <strong>16 de Setembro, 2016</strong>
Last modified: 9 de Agosto, 2024

---

Buscar plugins

Este plugin **non se actualizou en máis de 2 anos**. É posible que xa non sexa compatible
ou mantido por ninguén, ou podes ter problemas de compatibilidade cando se usa con
novas versións de WordPress.

![](https://ps.w.org/if-as-shortcode/assets/icon-256x256.png?rev=3133338)

# IF AS Shortcode

 Por [Mohammad I. Okfie](https://profiles.wordpress.org/okfie/)

[Descargar](https://downloads.wordpress.org/plugin/if-as-shortcode.1.2.zip)

 * [Detalles](https://gl.wordpress.org/plugins/if-as-shortcode/#description)
 * [Valoracións](https://gl.wordpress.org/plugins/if-as-shortcode/#reviews)
 *  [Instalación](https://gl.wordpress.org/plugins/if-as-shortcode/#installation)
 * [Desenvolvemento](https://gl.wordpress.org/plugins/if-as-shortcode/#developers)

 [Soporte](https://wordpress.org/support/plugin/if-as-shortcode/)

## Descrición

This is plugin help you to add conditions inside any post types, menus, and widgets
to restrict the content by use shortcode without use php code or other language :).

#### Posts/Pages/Other Post Types :

 1. Create new content and in above tinymce editor you will see button it’s name is“
    IF”.
 2. Click “IF” button and choose the condition you need to use inside content area.
 3. You can select the true block and write otherwise inside else block.
 4. Save your content and publish to see it!

#### Menus :

 1. Click in left side “Appearance”
 2. Choose from it “Menus” page.
 3. You must show description field for every menu by this way :
 4. Click “Screen Options” up the menu page.
 5. Chack “Description” from that tab.
 6. Now you can add your restrict content from “Shortcode” tab.

#### Widgets :

 1. Click in left side “Appearance”
 2. Choose from it “Widgets” page.
 3. Now you have box it’s name “The restricted content”.
 4. You can move it to any sidebar and fill the felids.

#### Translations

 * Arabic
 * English

### List of conditions

 * [if current_user_can capability=”administrator”]True content[else]False content[/
   if]
 * [if current_user_can capability=”editor”]True content[else]False content[/if]
 * [if current_user_can capability=”author”]True content[else]False content[/if]
 * [if current_user_can capability=”contributor”]True content[else]False content[/
   if]
 * [if current_user_can capability=”subscriber”]True content[else]False content[/
   if]
 * [if is_user_logged_in]True content[else]False content[/if]
 * [if has_post_thumbnail]True content[else]False content[/if]
 * [if comments_open]True content[else]False content[/if]
 * [if has_tag]True content[else]False content[/if]
 * [if is_attachment]True content[else]False content[/if]
 * [if has_excerpt]True content[else]False content[/if]
 * [if pings_open]True content[else]False content[/if]
 * [if is_home]True content[else]False content[/if]
 * [if is_rtl]True content[else]False content[/if]

### Example

 * Show content for who logged in
    [if is_user_logged_in] Welcome [else] You must
   login to see this content [/if]

## Capturas

[⌊Button to add new condition.⌉⌊Button to add new condition.⌉[

Button to add new condition.

[⌊Generate new content shows only for subscribers.⌉⌊Generate new content shows only
for subscribers.⌉[

Generate new content shows only for subscribers.

[⌊Sample of shortcode after putting the content.⌉⌊Sample of shortcode after putting
the content.⌉[

Sample of shortcode after putting the content.

## Instalación

#### Installation Automatically

 1. Click Plugins in the menu dashboard.
 2. Click Add New.
 3. Upload and choose “if-as-shortcode.zip” file and activate directly.
 4. After activated plugin you can use shortcode of if statement everywhere!

#### Installation Manually

 1. Download the plugin to your computer.
 2. Unzip the file and upload it to the “/wp-content/plugins/” by using FTP or Cpanel.
 3. Activate the plugin through the “Plugins” menu in WordPress dashboard.
 4. After activated plugin you can use shortcode of if statement everywhere!

## Comentarios

![](https://secure.gravatar.com/avatar/ed3d54516728b413860871df41b1e7d401e0c5912a93903aec9f7c16e7b2577b?
s=60&d=retro&r=g)

### 󠀁[Super easy and simple code](https://wordpress.org/support/topic/super-easy-and-simple-code/)󠁿

 [reiven](https://profiles.wordpress.org/reiven/) 6 de Novembro, 2019

Thanks!

![](https://secure.gravatar.com/avatar/14459e78fa5b51f15dbf64c71eb8a49b02bb1ecf20bcf554d368d21723162a4d?
s=60&d=retro&r=g)

### 󠀁[Funciona perfectamente](https://wordpress.org/support/topic/funciona-perfectamente-14/)󠁿

 [ferniwob](https://profiles.wordpress.org/ferniwob/) 17 de Novembro, 2016

Funciona perfectamente facil de entender i de utilizar

 [ Ler todas as 2 opinións ](https://wordpress.org/support/plugin/if-as-shortcode/reviews/)

## Colaboradores e desenvolvedores

“IF AS Shortcode” é un software de código aberto. As seguintes persoas colaboraron
con este plugin.

Colaboradores

 *   [ Mohammad I. Okfie ](https://profiles.wordpress.org/okfie/)

“IF AS Shortcode” foi traducido a 1 idioma. Grazas [aos desenvolvedores](https://translate.wordpress.org/projects/wp-plugins/if-as-shortcode/contributors)
polas súas contribucións.

[Traduce “IF AS Shortcode” ao teu idioma.](https://translate.wordpress.org/projects/wp-plugins/if-as-shortcode)

### Interesado no desenvolvemento?

[Revisa o código](https://plugins.trac.wordpress.org/browser/if-as-shortcode/), 
bota unha ollada ao[repositorio SVN](https://plugins.svn.wordpress.org/if-as-shortcode/),
ou subscríbete ao [log de desenvolvemento](https://plugins.trac.wordpress.org/log/if-as-shortcode/)
por [RSS](https://plugins.trac.wordpress.org/log/if-as-shortcode/?limit=100&mode=stop_on_copy&format=rss).

## Rexistro de cambios

#### 1.2

 * Some minor fixes.
 * New function to check status of [Classic Editor] plugin.
 * Tested with WP 6.6.X

#### 1.1

 * Change released version.
 * Test on WP 5.X.X

#### 1.0

 * First released version.

## Meta

 *  Versión **1.2**
 *  Última actualización **Fai 2 anos**
 *  Instalacións activas **10+**
 *  Versión de WordPress ** 4.0 ou superior **
 *  Probado ata **6.6.5**
 *  Versión de PHP ** 5.6 ou superior **
 *  Idiomas
 * [Arabic](https://ar.wordpress.org/plugins/if-as-shortcode/) e [English (US)](https://wordpress.org/plugins/if-as-shortcode/).
 *  [Traduce ao teu idioma](https://translate.wordpress.org/projects/wp-plugins/if-as-shortcode)
 * Etiquetas
 * [conditions](https://gl.wordpress.org/plugins/tags/conditions/)[if](https://gl.wordpress.org/plugins/tags/if/)
 *  [Vista avanzada](https://gl.wordpress.org/plugins/if-as-shortcode/advanced/)

## Valoracións

 5 de 5 estrelas

 *  [  2 valoracións de 5 estrelas     ](https://wordpress.org/support/plugin/if-as-shortcode/reviews/?filter=5)
 *  [  0 valoracións de 4 estrelas     ](https://wordpress.org/support/plugin/if-as-shortcode/reviews/?filter=4)
 *  [  0 valoracións de 3 estrelas     ](https://wordpress.org/support/plugin/if-as-shortcode/reviews/?filter=3)
 *  [  0 valoracións de 2 estrelas     ](https://wordpress.org/support/plugin/if-as-shortcode/reviews/?filter=2)
 *  [  0 valoracións de 1 estrelas     ](https://wordpress.org/support/plugin/if-as-shortcode/reviews/?filter=1)

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

[Ver todas as valoracións](https://wordpress.org/support/plugin/if-as-shortcode/reviews/)

## Colaboradores

 *   [ Mohammad I. Okfie ](https://profiles.wordpress.org/okfie/)

## Soporte

Tes algo que dicir? Necesitas axuda?

 [Ver o foro de soporte](https://wordpress.org/support/plugin/if-as-shortcode/)