Custom Merge Tags
-
Hi here! We still try used this plugin for our project, now i try add custom merge tag for custom trigger, i used this manual https://docs.bracketspace.com/docs/registering-custom-triggers/ (it really good examples) but i have some problem with merge tags.
I try add merge tag like thispublic function merge_tags() { $this->add_merge_tag( new \BracketSpace\Notification\Defaults\MergeTag\UrlTag( array( 'slug' => 'email', 'name' => __( 'User email', 'socialbet' ), 'resolver' => function( $trigger ) { return add_query_arg( 'source', $trigger->param_value, site_url() ); //return trim($trigger->param_value); }, 'description' => __( 'Email пользователя', 'socialbet' ), 'example' => true, ) ) ); } }
it’s work perfect with
return add_query_arg( ‘source’, $trigger->param_value, site_url() );
but then i try
return trim($trigger->param_value);
it’s return me NULL, so how i can return to merge tag just variable ?what am I doing wrong ?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Merge Tags’ is closed to new replies.