frontier_get_regex
The Pods - Custom Content Types and Fields frontier get regex function.
Description
frontier_get_regex( $codes );
Parameters (1)
- 0. $codes
- The codes.
Usage
if ( !function_exists( 'frontier_get_regex' ) ) { require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/components/Templates/includes/functions-view_template.php'; } // The codes. $codes = null; // NOTICE! Understand what this does before running. $result = frontier_get_regex($codes);
Defined (1)
The function is defined in the following location(s).
- /components/Templates/includes/functions-view_template.php
- function frontier_get_regex( $codes ) {
- // A custom version of the shortcode regex as to only use podsfrontier codes.
- // this makes it easier to cycle through and get the used codes for inclusion
- $validcodes = join( '|', array_map( 'preg_quote', $codes ) );
- return '\\[' // Opening bracket
- . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
- . "($validcodes)" // 2: selected codes only
- . '\\b' // Word boundary
- . '(' // 3: Unroll the loop: Inside the opening shortcode tag
- . '[^\\]\\/]*' // Not a closing bracket or forward slash
- . '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket
- . '[^\\]\\/]*' // Not a closing bracket or forward slash
- . ')*?' . ')' . '(?:' . '(\\/)' // 4: Self closing tag ...
- . '\\]' // ... and closing bracket
- . '|' . '\\]' // Closing bracket
- . '(?:' . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
- . '[^\\[]*+' // Not an opening bracket
- . '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
- . '[^\\[]*+' // Not an opening bracket
- . ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag
- . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]]
- }