| |
| <?php
|
|
|
|
|
|
|
|
|
|
|
|
|
| function wpf_post_submission_custom_content( $post_id, $fields, $form_data, $entry_id ) {
|
|
|
|
|
| if ( absint( $form_data[ 'id' ] ) !== 1089 ) {
|
| return;
|
| }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ob_start();
|
| ?>
|
|
|
| <h2><em><?php echo __('Author Profile', 'text-domain'); ?></em></h2>
|
|
|
| <h3><?php echo __('Name', 'text-domain'); ?></h3>
|
| <?php echo wpautop( esc_html( $fields[2][ 'value' ] ) ); ?>
|
|
|
| <h3><?php echo __('Birthday', 'text-domain'); ?></h3>
|
| <?php echo wpautop( esc_html( $fields[15][ 'value' ] ) ); ?>
|
|
|
| <h3><?php echo __('My friends would describe me as', 'text-domain'); ?></h3>
|
| <?php echo wpautop( esc_html( $fields[16][ 'value' ] ) ); ?>
|
|
|
| <h3><?php echo __('The most influential person in my life has been...', 'text-domain'); ?></h3>
|
| <?php echo wpautop( esc_html( $fields[18][ 'value' ] ) ); ?>
|
|
|
| <h3><?php echo __('Five things I couldn\'t live without', 'text-domain'); ?></h3>
|
| <?php echo wpautop( esc_html( $fields[19][ 'value' ] ) ); ?>
|
|
|
| <?php
|
| $content = ob_get_clean();
|
|
|
| remove_filter('content_save_pre', 'wp_filter_post_kses');
|
| remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
|
|
|
| $post = array(
|
| 'ID' => $post_id,
|
| 'post_content' => $content,
|
| );
|
| wp_update_post( $post );
|
|
|
| add_filter('content_save_pre', 'wp_filter_post_kses');
|
| add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
|
| }
|
| add_action( 'wpforms_post_submissions_process', 'wpf_post_submission_custom_content', 10, 4 );
|
| |
| |