Skip to content

Commit

Permalink
use postAuthorEmail (#41290)
Browse files Browse the repository at this point in the history
  • Loading branch information
lezama authored Jan 24, 2025
1 parent 861a579 commit 32de098
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions projects/packages/forms/changelog/fix-forms-send-to-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Forms: fix send to settings for multiple authors
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ public static function gutenblock_render_form( $atts, $content ) {
* Loads scripts
*/
public static function load_editor_scripts() {
global $post;

$handle = 'jp-forms-blocks';

Expand All @@ -171,10 +170,14 @@ public static function load_editor_scripts() {
)
);

// Create a Contact_Form instance to get the default values
$contact_form = new Contact_Form( array() );
$defaults = $contact_form->defaults;

$data = array(
'defaults' => array(
'to' => wp_get_current_user()->user_email,
'subject' => '[' . get_bloginfo( 'name' ) . ']' . ( isset( $post ) ? ' ' . esc_html( $post->post_title ) : '' ),
'to' => $defaults['to'],
'subject' => $defaults['subject'],
),
);

Expand Down

0 comments on commit 32de098

Please sign in to comment.