Skip to:
Content
Pages
Categories
Search
Top
Bottom

Making a plugin in the sign-up page

  • Hey, I got a client that wants to auto-fill some fields in the sign-up page with info gathered from a LinkedIn’s profile. All good, except the part when he said ‘No hardcoding’ which is logical.

    In the file:

    wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php

    switch ( $this->type ) {
    case 'textbox':
    $html .= '<div class="signup-field">';
    $html .= '<label class="signup-label" for="field_' . $this->id . '">' . $asterisk . $this->name . ':</label>';
    $html .= $this->message . '<input type="text" name="field_' . $this->id . '" id="field_' . $this->id . '" value="' . attribute_escape( $this->data->value ) . '" />';
    $html .= '<span class="signup-description">' . $this->desc . '</span>';
    $html .= '</div>';
    break;

    Specifically:

    $html .= $this->message . '<input type="text" name="field_' . $this->id . '" id="field_' . $this->id . '" value="' . attribute_escape( $this->data->value ) . '" />';

    Where you set the predefied value of the field. I just need to alter $this->data->value somewhere before that.

    How could I achieve this with a plug-in, if possible?

The topic ‘Making a plugin in the sign-up page’ is closed to new replies.