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
Restrict_Content_Tokens::possible_tokens( array $tokens = array(), array $args = array() )


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

$tokens

(Optional)

Default value: array()

$args

(Optional)

Default value: array()


Top ↑

Return Return

(array)


Source Source

File: src/integrations/restrict-content/tokens/restrict-content-tokens.php

	public function possible_tokens( $tokens = array(), $args = array() ) {
		if ( ! isset( $args['value'] ) || ! isset( $args['meta'] ) ) {
			return $tokens;
		}
		if ( empty( $args['value'] ) || empty( $args['meta'] ) ) {
			return $tokens;
		}
		$id = $args['value'];
		$new_tokens = array();
		if ( ! empty( $id ) && absint( $id ) ) {
			$new_tokens[] = [
				'tokenId'         => 'RCMEMBERSHIPLEVEL_INITIAL',
				'tokenName'       => _x( 'Membership initial payment', 'Restrict Content', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => 'RCPURCHASESMEMBERSHIP',
			];
			$new_tokens[] = [
				'tokenId'         => 'RCMEMBERSHIPLEVEL_RECURRING',
				'tokenName'       => _x( 'Membership recurring payment', 'Restrict Content', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => 'RCPURCHASESMEMBERSHIP',
			];
			$tokens = array_merge( $tokens, $new_tokens );
		}
		return $tokens;
	}