Skip to content

Commit

Permalink
Add first_name to the onboarding form
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Apr 11, 2024
1 parent 2532bcd commit 1235e48
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions classes/class-onboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function on_activate_plugin( $plugin ) {
return;
}

\wp_safe_redirect( admin_url( 'admin.php?page=progress-planner' ) );
\wp_safe_redirect( \admin_url( 'admin.php?page=progress-planner' ) );
exit;
}

Expand All @@ -58,15 +58,23 @@ public function on_activate_plugin( $plugin ) {
* @return void
*/
public static function the_form() {
$current_user = wp_get_current_user();
$current_user = \wp_get_current_user();
?>
<form id="prpl-onboarding-form">
<label>
<?php esc_html_e( 'Email', 'progress-planner' ); ?>
<?php \esc_html_e( 'First Name', 'progress-planner' ); ?>
<input
type="name"
name="name"
value="<?php echo \esc_attr( \get_user_meta( $current_user->id, 'first_name', true ) ); ?>"

Check failure on line 69 in classes/class-onboard.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Access to an undefined property WP_User::$id.

Check failure on line 69 in classes/class-onboard.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Access to an undefined property WP_User::$id.
>
</label>
<label>
<?php \esc_html_e( 'Email', 'progress-planner' ); ?>
<input
type="email"
name="email"
value="<?php echo esc_attr( $current_user->user_email ); ?>"
value="<?php echo \esc_attr( $current_user->user_email ); ?>"
>
</label>
<label>
Expand All @@ -75,22 +83,22 @@ public static function the_form() {
name="consent"
required
>
<?php esc_html_e( 'I consent to sending my data to the remote server.', 'progress-planner' ); ?>
<?php \esc_html_e( 'I consent to sending my data to the remote server.', 'progress-planner' ); ?>
</label>
<input
type="hidden"
name="site"
value="<?php echo esc_attr( site_url() ); ?>"
value="<?php echo \esc_attr( \site_url() ); ?>"
>
<input
type="submit"
value="<?php esc_attr_e( 'Start the onboarding process!', 'progress-planner' ); ?>"
value="<?php \esc_attr_e( 'Start the onboarding process!', 'progress-planner' ); ?>"
class="button button-primary"
>
</form>

<a style="display:none;" id="prpl-password-reset-link">
<?php esc_html_e( 'Registration successful. Set your password now and edit your profile', 'progress-planner' ); ?>
<?php \esc_html_e( 'Registration successful. Set your password now and edit your profile', 'progress-planner' ); ?>
</a>

<div id="progress-planner-scan-progress" style="display:none;">
Expand Down

0 comments on commit 1235e48

Please sign in to comment.