{"id":106364,"date":"2019-07-10T07:44:51","date_gmt":"2019-07-10T07:44:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/conditional-statements\/"},"modified":"2019-07-10T07:44:51","modified_gmt":"2019-07-10T07:44:51","slug":"conditional-statements","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/conditional-statements\/","author":14152013,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0","stable_tag":"1.0","tested":"5.2.28","requires":"4.2.0","requires_php":"5.5","requires_plugins":"","header_name":"Conditional Statements","header_author":"YeKen","header_description":"\/\/ TODO","assets_banners_color":"","last_updated":"2019-07-10 07:44:51","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/yeken","header_plugin_uri":"","header_author_uri":"http:\/\/www.YeKen.uk","rating":0,"author_block_rating":0,"active_installs":10,"downloads":703,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"2120525","resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"2120525","resolution":"256x256","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[4060,35790,35786,168818,144778],"plugin_category":[],"plugin_contributors":[83689],"plugin_business_model":[],"class_list":["post-106364","plugin","type-plugin","status-closed","hentry","plugin_tags-conditional","plugin_tags-else","plugin_tags-if","plugin_tags-statement","plugin_tags-statements","plugin_contributors-aliakro","plugin_committers-aliakro"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/conditional-statements.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Conditional Statements allows you to add logic into your pages. The plugin supports various conditions allowing you to apply IF statements.<\/p>\n\n<p>For example: \"IF the user is logged in display X ELSE display Y\" would look like:<\/p>\n\n<p>[cs-if conditions=\"is-logged-in\"]<\/p>\n\n<p>Welcome Back!<\/p>\n\n<pre><code>[gallery]\n<\/code><\/pre>\n\n<p>[else]<\/p>\n\n<p>You must be logged in to view the gallery.<\/p>\n\n<p>[\/cs-if]<\/p>\n\n<p>You can also nest conditions e.g.<\/p>\n\n<p>[cs-if conditions=\"is-logged-in\"]<\/p>\n\n<p>The user is logged in.<\/p>\n\n<p>[cs-if-1 conditions=\"firstname\"]\n    The user has entered a first name!\n  [else-1]\n    The user must enter a first name!\n  [\/cs-if-1]\n  [cs-if-1 conditions=\"lastname\"]\n    The user has entered a last name!\n  [else-1]\n    The user must enter a last name!\n  [\/cs-if-1]\n[\/cs-if]<\/p>\n\n<p>Simply add a hyphen and the depth (up to a maximum of 5) e.g. [cs-if-1], [cs-if-2], [cs-if-3] and so on.<\/p>\n\n<h4>Examples<\/h4>\n\n<p>Please look at these examples on how to use the Conditional Statements shortcode:<\/p>\n\n<p><a href=\"https:\/\/gist.github.com\/yekenuk\/2e61c83fc72b990878c55affa05e6d09\" title=\"Examples of how to use Conditional Statements\">Examples of how to use Conditional Statements<\/a><\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Supports nesting of IF statements (upto 5 deep)<\/li>\n<li>AND logic. If you specify more than one condition, the conditions are AND'd (e.g. all conditions must be met for the condition to be true)<\/li>\n<li>ELSE conditions<\/li>\n<li>Comparisons e.g. \"does the post type equal 'article'\"<\/li>\n<\/ul>\n\n<p>[cs-if conditions=\"post-type\" operator=\"equals\" compare-value=\"article\"]\n  Post Type is Article\n[else]\n  [cs-if-1 conditions=\"post-type\" operator=\"equals\" compare-value=\"post\"]\n    Post Type is Post\n  [else-1]\n    Post type is not Article or Post.\n  [\/cs-if-1]\n[\/cs-if]<\/p>\n\n<h4>Supported Conditions<\/h4>\n\n<ul>\n<li>[cs-if conditions=\"is-logged-in\"] (supported operators: equals) - User logged in<\/li>\n<li>[cs-if conditions=\"ip\"] (supported operators: equals) - User's IP<\/li>\n<li>[cs-if conditions=\"first-name\"] (supported operators: equals, exists, not-exists) - User's first name<\/li>\n<li>[cs-if conditions=\"last-name\"] (supported operators: equals, exists, not-exists) - User's last name.<\/li>\n<li>[cs-if conditions=\"display-name\"] (supported operators: equals, exists, not-exists) - User's display name.<\/li>\n<li>[cs-if conditions=\"user-id\"] (supported operators: equals) - User's ID.<\/li>\n<li>[cs-if conditions=\"post-id\"] (supported operators: equals) - Post ID of current post in loop.<\/li>\n<li>[cs-if conditions=\"post-slug\"] (supported operators: equals) - Slug of current post in loop.<\/li>\n<li>[cs-if conditions=\"post-type\"] (supported operators: equals) - Post type of current post in loop.<\/li>\n<\/ul>\n\n<p>To suggest new conditions, email me at: email@yeken.uk<\/p>\n\n<h4>Coming Soon<\/h4>\n\n<ul>\n<li>Support for ELSE IF statements<\/li>\n<li>OR statements<\/li>\n<li>New conditions (please email suggestions email@yeken.uk)<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Login into Wordpress Admin Panel<\/li>\n<li>Navigate to Plugins &gt; Add New<\/li>\n<li>Search for \"Conditional Statements\"<\/li>\n<li>Click Install now and activate plugin<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>What is the best way to suggest a new condition?<\/dt>\n<dd><p>Drop me an email: email@yeken.uk<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial Build<\/li>\n<\/ul>","raw_excerpt":"Add Conditional Statements to your post content e.g. IF the user is logged in display &quot;Welcome back!&quot;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/106364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=106364"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/aliakro"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=106364"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=106364"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=106364"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=106364"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=106364"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=106364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}