Adding Field on Registration form + Unexpected Results
-
Greetings.
Some time ago i asked about some settings to add custom fields without the Custom Fields Add On. Thinking in that option i thought that could be possible to add such fields on the Registration form. After looking the WPAdverts core and WP Adverts Custom fields i kind of reach the objective.
This is an User Registration from the Authors add on with an addition on the functions.php of the theme. (If the live site is not available)
https://imgur.com/a/8Tlf3GG
I reached it adding this code on the functions.php of the theme:
add_filter( "adverts_form_load", "featured_xx" ); function featured_xx( $form_scheme ) { $form_scheme['field'][] = array( "name" => "_item_author_demo", "type" => "adverts_field_header", "order" => 10005, "label" => __( 'DEMO', 'wpadverts-authors' ) ); $form_scheme['field'][] = array( "name" => "_item_author_image1", "type" => "adverts_field_gallery", "order" => 10006, "label" => __( 'Cargar', 'wpadverts-authors' ), "validator" => array( array( "name" => "upload_type", "params" => array( "allowed" => array( "image" ) ) ) ) ); return $form_scheme; }
But I have 2 Unexpected Side Effects:
- First is that the Image / Gallery component doesnt work at all, i’m not fully sure how to enable it to add what i need (Since it is plausible that i require a second field of that kind
- Second After adding the first field on the search bar it added automatically an “Advanced Search” dropdown, but i can’t remove it without hiding it via CSS (which can be done but i don’t think that is the correct solution), since i think that the addition throws an error once is deployed.
I know that it seems a bit tricky but if the experience i had first on the manual custom fields serves me of something the additional fields allow me to add that data to the profile and display it as i need it.
Thanks in advance for the help you can provide.
The page I need help with: [log in to see the link]
- The topic ‘Adding Field on Registration form + Unexpected Results’ is closed to new replies.