{"id":50875,"date":"2016-09-16T04:44:15","date_gmt":"2016-09-16T04:44:15","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/if-as-shortcode\/"},"modified":"2024-08-09T20:31:43","modified_gmt":"2024-08-09T20:31:43","slug":"if-as-shortcode","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/if-as-shortcode\/","author":13766497,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2","stable_tag":"1.2","tested":"6.6.5","requires":"4.0","requires_php":"5.6","requires_plugins":null,"header_name":"If As Shortcode","header_author":"Mohammad Okfie","header_description":"","assets_banners_color":"","last_updated":"2024-08-09 20:31:43","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/if-as-shortcode","header_author_uri":"https:\/\/mokfie.sa","rating":5,"author_block_rating":0,"active_installs":10,"downloads":3631,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.0":{"tag":"1.0","author":"okfie","date":"2024-08-09 20:31:43"},"1.1":{"tag":"1.1","author":"okfie","date":"2024-08-09 20:31:43"},"1.2":{"tag":"1.2","author":"okfie","date":"2024-08-09 20:31:43"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"2"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3133338,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3133338,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3133338,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3133338,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3133338,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Button to add new condition.","2":"Generate new content shows only for subscribers.","3":"Sample of shortcode after putting the content."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[5106,35786,77108,77109,230508],"plugin_category":[],"plugin_contributors":[82314],"plugin_business_model":[],"class_list":["post-50875","plugin","type-plugin","status-publish","hentry","plugin_tags-conditions","plugin_tags-if","plugin_tags-if_statement","plugin_tags-page_templete_conditions","plugin_tags-post_templete_conditions","plugin_contributors-okfie","plugin_committers-okfie"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/if-as-shortcode\/assets\/icon-128x128.png?rev=3133338","icon_2x":"https:\/\/ps.w.org\/if-as-shortcode\/assets\/icon-256x256.png?rev=3133338","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/if-as-shortcode\/assets\/screenshot-1.png?rev=3133338","caption":"Button to add new condition."},{"src":"https:\/\/ps.w.org\/if-as-shortcode\/assets\/screenshot-2.png?rev=3133338","caption":"Generate new content shows only for subscribers."},{"src":"https:\/\/ps.w.org\/if-as-shortcode\/assets\/screenshot-3.png?rev=3133338","caption":"Sample of shortcode after putting the content."}],"raw_content":"<!--section=description-->\n<p>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 :).<\/p>\n\n<h4>Posts\/Pages\/Other Post Types :<\/h4>\n\n<ol>\n<li>Create new content and in above tinymce editor you will see button it's name is \"IF\".<\/li>\n<li>Click \"IF\" button and choose the condition you need to use inside content area.<\/li>\n<li>You can select the true block and write otherwise inside else block.<\/li>\n<li>Save your content and publish to see it!<\/li>\n<\/ol>\n\n<h4>Menus :<\/h4>\n\n<ol>\n<li>Click in left side \"Appearance\"<\/li>\n<li>Choose from it \"Menus\" page.<\/li>\n<li>You must show description field for every menu by this way :<\/li>\n<li>Click \"Screen Options\" up the menu page.<\/li>\n<li>Chack \"Description\" from that tab.<\/li>\n<li>Now you can add your restrict content from \"Shortcode\" tab.<\/li>\n<\/ol>\n\n<h4>Widgets :<\/h4>\n\n<ol>\n<li>Click in left side \"Appearance\"<\/li>\n<li>Choose from it \"Widgets\" page.<\/li>\n<li>Now you have box it's name \"The restricted content\".<\/li>\n<li>You can move it to any sidebar and fill the felids.<\/li>\n<\/ol>\n\n<h4>Translations<\/h4>\n\n<ul>\n<li>Arabic <\/li>\n<li>English<\/li>\n<\/ul>\n\n<h3>List of conditions<\/h3>\n\n<ul>\n<li>[if current_user_can capability=\"administrator\"]True content[else]False content[\/if]<\/li>\n<li>[if current_user_can capability=\"editor\"]True content[else]False content[\/if]<\/li>\n<li>[if current_user_can capability=\"author\"]True content[else]False content[\/if]<\/li>\n<li>[if current_user_can capability=\"contributor\"]True content[else]False content[\/if]<\/li>\n<li>[if current_user_can capability=\"subscriber\"]True content[else]False content[\/if]<\/li>\n<li>[if is_user_logged_in]True content[else]False content[\/if]<\/li>\n<li>[if has_post_thumbnail]True content[else]False content[\/if]<\/li>\n<li>[if comments_open]True content[else]False content[\/if]<\/li>\n<li>[if has_tag]True content[else]False content[\/if]<\/li>\n<li>[if is_attachment]True content[else]False content[\/if]<\/li>\n<li>[if has_excerpt]True content[else]False content[\/if]<\/li>\n<li>[if pings_open]True content[else]False content[\/if]<\/li>\n<li>[if is_home]True content[else]False content[\/if]<\/li>\n<li>[if is_rtl]True content[else]False content[\/if]<\/li>\n<\/ul>\n\n<h3>Example<\/h3>\n\n<ul>\n<li>Show content for who logged in\n[if is_user_logged_in]\nWelcome\n[else]\nYou must login to see this content\n[\/if]<\/li>\n<\/ul>\n\n<!--section=installation-->\n<h4>Installation Automatically<\/h4>\n\n<ol>\n<li>Click Plugins in the menu dashboard.<\/li>\n<li>Click Add New.<\/li>\n<li>Upload and choose \"if-as-shortcode.zip\" file and activate directly.<\/li>\n<li>After activated plugin you can use shortcode of if statement everywhere!<\/li>\n<\/ol>\n\n<h4>Installation Manually<\/h4>\n\n<ol>\n<li>Download the plugin to your computer.<\/li>\n<li>Unzip the file and upload it to the \"\/wp-content\/plugins\/\" by using FTP or Cpanel.<\/li>\n<li>Activate the plugin through the \"Plugins\" menu in WordPress dashboard.<\/li>\n<li>After activated plugin you can use shortcode of if statement everywhere!<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.2<\/h4>\n\n<ul>\n<li>Some minor fixes.<\/li>\n<li>New function to check status of [Classic Editor] plugin.<\/li>\n<li>Tested with WP 6.6.X<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Change released version.<\/li>\n<li>Test on WP 5.X.X<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First released version.<\/li>\n<\/ul>","raw_excerpt":"You can use if statement as shortcode everywhere you want!","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/50875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=50875"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/okfie"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=50875"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=50875"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=50875"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=50875"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=50875"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=50875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}