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
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
Tokens::is_valid( $meta, $token )
Contents
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
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
- $meta
(Required)
- $token
(Required)
Return Return
(bool)
Source Source
File: src/core/lib/recipe-parts/trait-tokens.php
public static function is_valid( $meta, $token ) { /** * @var mixed $value * @var array $pieces * @var int $recip_id * @var array $trigger_data * @var int $user_id * @var array $replace_args */ extract( $token ); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract if ( ! $pieces ) { // Token array is empty. return false; } if ( ! array_key_exists( 2, $pieces ) || empty( $pieces[2] ) ) { // Token is missing. return false; } if ( $meta !== $pieces[2] ) { // Token doesn't match trigger meta. return false; } if ( ! array_key_exists( 0, $trigger_data ) || empty( $trigger_data[0] ) ) { // Trigger data is empty. return false; } if ( empty( $trigger_data[0]['meta'] ) ) { // Trigger meta is empty. return false; } return true; }
Expand full source code Collapse full source code View on Github