{"id":6294,"date":"2020-09-04T00:32:31","date_gmt":"2020-09-04T00:32:31","guid":{"rendered":"https:\/\/the7kennisbank.nl\/uncategorized\/condition-builder-wp-brain\/"},"modified":"2020-09-04T00:56:05","modified_gmt":"2020-09-04T00:56:05","slug":"condition-builder-wp-brain","status":"publish","type":"post","link":"https:\/\/the7kennisbank.nl\/en\/wp-brain\/condition-builder-wp-brain\/","title":{"rendered":"Condition Builder \u2013 WP Brain"},"content":{"rendered":"
<\/p>\n
The condition builder is the base and the most important part of WP Brain, it\u2019s where you build the conditions that control the display of elements.<\/p>\n
<\/p>\n
In WP Brain, a condition is a group of rules linked via logic operators AND\/OR. The result of condition will be either true<\/strong> or false<\/strong>. If the validation succeeded, the elements will be shown, otherwise, the elements wrapped by the next fallback container (WP Brain Else) will be shown instead.<\/p>\n Understanding the logical operators is a must have when you build conditions, but in WP Brain they pretty simple to get in hand and master their usage.<\/p>\n As we said above, a conditions is a group of rules, these rules are linked to each other via what we call a logical operator. WP Brain use two operators:<\/p>\n AND<\/strong>: This logical operator will assure that all of linked rules and sub-groups are valid. When used in main condition, if any of them are not valid, then the validation will fail. But if used a sub-group, it will be valid if all rules are valid too.<\/p>\n OR<\/strong>: Unlike the first operator, this one will make sure that just one rule or sub-group is valid to validate the condition and stop going throughout the rules tree. and the same apply to the validation of sub-groups.<\/p>\n The Condition builder is designed in way that simplify the use of these operators with a tree of lines that illustrate the links between the rules and an operator, so the hardest part is learning how to make combination of both operators to build your desired conditions.<\/p>\n Each rule in WP Brain must contain a comparator to allow validation of the real filter value against the given value, these comparators are enabled based on the type of the value, for example numeric value accept extra comparators than boolean values.<\/p>\n Trying to cover almost every logic comparison you will think about, WP Brain now support the following 22 comparators:<\/p>\n These operators require different number of values and inputs, while some of them require two value (the case of \u201cbetween\u201d operator), others doesn\u2019t need any value (i.e. Is empty, Is not empty, Is null, Is not null, Yes and No).<\/p>\n The Regular expression<\/strong> is and advanced operator that should be used only by experts who know what that mean. If you need more details please contact the support.<\/p>\n<\/div>\n WP Brain come with lot of handy and useful filters out of the box, you can achieve unlimited possibilities with these built-in filters, all you have to do is find the right combination for your logic conditions.<\/p>\n The condition builder is the base and the most important part of WP Brain, it\u2019s where you build the conditions that control the display of elements. In WP Brain, a condition is a group of rules linked via logic operators AND\/OR. The result of condition will be either true or false. If the validation…<\/p>\n","protected":false},"author":2,"featured_media":6318,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[58],"tags":[],"class_list":["post-6294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wp-brain","category-58","description-off"],"acf":[],"_links":{"self":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/6294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/comments?post=6294"}],"version-history":[{"count":3,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/6294\/revisions"}],"predecessor-version":[{"id":6365,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/posts\/6294\/revisions\/6365"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media\/6318"}],"wp:attachment":[{"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/media?parent=6294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/categories?post=6294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the7kennisbank.nl\/en\/wp-json\/wp\/v2\/tags?post=6294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}Logical Operators<\/h3>\n
Rule Comparators<\/h3>\n
<\/p>\nNote:<\/h4>\n
Built-in Filters<\/h3>\n
\n