Wpum_Tokens::wpum_fields_possible_tokens( array $tokens = array(), array $args = array() )
Contents
Parameters Parameters
- $tokens
-
(array) (Optional)
Default value: array()
- $args
-
(array) (Optional)
Default value: array()
Return Return
(array)
Source Source
File: src/integrations/wp-user-manager/tokens/wpum-tokens.php
public function wpum_fields_possible_tokens( $tokens = array(), $args = array() ) { $trigger_meta = $args['meta']; $all_fields = WPUM()->fields->get_fields( [ 'group_id' => false, 'orderby' => 'field_order', 'order' => 'ASC', ] ); foreach ( $all_fields as $field ) { $field = new \WPUM_Field( $field ); if ( $field->exists() && $field->get_meta( 'editing' ) == 'public' && $field->get_primary_id() !== 'user_password' ) { // Skip the avatar field if disabled. if ( $field->get_primary_id() == 'user_avatar' && ! wpum_get_option( 'custom_avatars' ) ) { continue; } $fields[] = [ 'tokenId' => $field->get_primary_id(), 'tokenName' => $field->get_name(), 'tokenType' => $field->get_type(), 'tokenIdentifier' => $trigger_meta, ]; } } $tokens = array_merge( $tokens, $fields ); return $tokens; }
Expand full source code Collapse full source code View on Github