is_registered() && $ai_fs->is_tracking_allowed()) || $ai_fs->can_use_premium_code__premium_only()); if ($showHelp) { ?>

This is a small jQuery selector help which is optimized for the advanced iframes scenarios.

What are jQuery selectors?

jQuery selectors are one of the most important aspects of the jQuery library. These selectors use familiar CSS syntax to allow page authors to quickly and easily identify any set of page elements to operate upon with the jQuery library methods. Understanding jQuery selectors is the key to using the jQuery library most effectively. The selector is a string expression that identifies the set of DOM elements that will be collected into a matched set to be operated upon by the jQuery methods.

Types of jQuery selectors?

The "Basic Selectors" are known as "find selectors" as they are used to find elements within the DOM. The "Positional" and "Custom Selectors" are "filter selectors" as they filter a set of elements (which defaults to the entire set of elements in the DOM). This extract will focus on the basic selectors as they are most important and will cover most of your needs.

Basic CSS Selectors

These selectors follow standard CSS3 syntax and semantics. For more selectors and examples go to https://api.jquery.com//category/selectors.

Syntax Description
E Matches all elements with tag name E.
#i Matches all elements with the id="i".
.c Matches all elements with the class="c".
.c.d Matches all elements with the class="c d". So in the HTML they are separated by a space. In jQuery they both need to have a . in front without a space.
E F Matches all elements with tag name F that are descendants of E.
#i .c Matches all elements with class c that are descendants of the element with the id i.
E>F Use E##F. ## is converted to >. Matches all elements with tag name F that are direct children of E.
E+F Matches all elements with tag name F that are immediately preceded by a sibling of tag name E.
E~F Matches all elements with tag name F that are preceded by any sibling of tag name E.
E.c Matches all elements E that possess a class name of c. Omitting E is identical to *.c.
E#i Matches all elements E that possess an id value of i. Omitting E is identical to *#i.
E[a] Matches all elements E that posses an attribute a of any value.
E[a=v] Matches all elements E that posses an attribute a whose value is exactly v.
E[a^=v] Matches all elements E that posses an attribute a whose value starts with v.
E[a$=v] Matches all elements E that posses an attribute a whose value ends with v.
E[a*=v] Matches all elements E that posses an attribute a whose value contains v.

Additional useful selectors

These selectors are basic filters provided by jQuery I found useful using in this plugin. For more selectors and examples go to https://api.jquery.com//category/selectors.

E:not(selector) Remove elements from the set of matched elements.
E:eq(index) Select the element at index n within the matched set.
E:last() Selects the last matched element.
E:nth-child(index) Selects all elements that are the nth-child of their parent.

Examples

You can create the union of multiple disparate selectors by listing them, separated by commas. For example, the following matches all <div> and <p> elements: div,p

Usage in Advanced iframe

Above the default usage in jQuery is shown in the examples In Advanced iFrame the jQuery part is already rendered by the plugin. Therefore you only need to specify the selector. Also the following two rules apply:
  1. Only single quotes are allowed. So please always use \' and never ".
  2. Because brackets [ ... ] are replaced in the short code by Wordpress you need to replace [...] them with {{ ... }}
Examples: ', 'advanced-iframe'); } else { echo '

'; _e('This help is available for PRO users or if you OPT-IN.', 'advanced-iframe'); echo '

'; } aiPostboxClose(); ?>