开发者 | apos37 |
---|---|
更新时间 | 2024年11月13日 07:15 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Join my Discord support server
From the form's Discord feed, you can mention a user with {{@user_id}}
or a role with {{@&role_id}}
, and tag a channel with {{#channel_id}}
. If you're unfamiliar with where to find these IDs, check out this article on Discord.
With version 1.0.6, you can now use the following hook: `<?php add_filter( 'gf_discord_embeds', 'my_gf_discord_embeds', 10, 3 ); function my_gf_discord_embeds( $embeds, $form, $entry ) { // Filter the message $embeds[0][ 'description' ] = str_replace( '{{my_own_merge_tag}}', 'New Value', $embeds[0][ 'description' ] ); // Add a new field $user_id = $entry[ 'created_by' ]; $user = get_user_by( 'ID', $user_id ); $display_name = $user->display_name; $embeds[0][ 'fields' ][] = [ 'name' => 'Completed By:', 'value' => $display_name ]; // Always return embeds return $embeds; } // End my_gf_discord_embeds() ?>`
{{@&role_id}}
{{#channel_id}}
{{@user_id}}
(props yaboinish)