Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Copy_Recipe_Parts::replace_trigger_token_ids( $content )
Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Parameters Parameters
- $content
(Required)
Return Return
(array|mixed|string|string[]|null)
Source Source
File: src/core/admin/class-copy-recipe-parts.php
public function replace_trigger_token_ids( $content ) { // Loop thru multiple triggers and update token's trigger ID based on that. foreach ( $this->trigger_tokens as $prev_id => $new_id ) { // Sanity check if ( is_array( $prev_id ) || is_array( $new_id ) ) { continue; } // check if content contains a replaceable token by previous ID if ( preg_match( '/{{' . $prev_id . '\:\w.+?}}/', $content ) ) { $content = preg_replace( '/{{' . $prev_id . ':/', '{{' . $new_id . ':', $content ); } } return $content; }
Expand full source code Collapse full source code View on Github