Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter richdal

    (@richdal)

    A CSS and jQuery approach looks a lot simpler. I’ll give that a try. Thanks for the help.

    Thread Starter richdal

    (@richdal)

    Before I installed this plugin I was able to make some basic changes to BuddyPress profile edit form and was trying to apply the same logic here. I had to make a custom class file by copying the original from core and adjusting a few names. I can get the BuddyPress datebox changes linked up, but can’t get the birthdate one in this plugin.

    For the datebox I copied the original to my child theme and renamed the files and class names…

    Datebox change
    Original: /wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {

    Custom: /wp-content/themes/genbu-child/custom_class-bp-xprofile-field-type-profile-datebox.inc

    class Custom_BP_XProfile_Field_Type_Profile_Datebox extends BP_XProfile_Field_Type {

    Birthdate change
    Original: /wp-content/plugins/buddypress-xprofile-custom-fields-type/classes/Bxcft_Field_Type_Birthdate.php

    if (!class_exists('Bxcft_Field_Type_Birthdate'))
    {
        class Bxcft_Field_Type_Birthdate extends BP_XProfile_Field_Type

    Custom: /wp-content/themes/genbu-child/custom_bxcft_field_type_birthdate.inc

    if (!class_exists('Custom_Bxcft_Field_Type_Birthdate'))
    {
        class Custom_Bxcft_Field_Type_Birthdate extends BP_XProfile_Field_Type

    In the theme’s functions.php file I added..

    include 'custom_class-bp-xprofile-field-type-profile-datebox.inc';
    include 'custom_bxcft_field_type_birthdate.inc';
    function custom_bp_xprofile_create_uprofile_field_type( $type ) {
    
            $field = custom_bp_xprofile_get_uprofile_field_types();
            $class = isset( $field[$type] ) ? $field[$type] : '';
    
            /**
             * To handle (missing) field types, fallback to a placeholder field object if a type is unknown.
             */
            if ( $class && class_exists( $class ) ) {
                    return new $class;
            } else {
                    return new BP_XProfile_Field_Type_Placeholder;
            }
    }
    function custom_bp_xprofile_get_uprofile_field_types() {
            $fields = array(
            'checkbox'       => 'BP_XProfile_Field_Type_Checkbox',
            'datebox'        => 'Custom_BP_XProfile_Field_Type_Profile_Datebox',
            'birthdate'      => 'Custom_Bxcft_Field_Type_Birthdate',
            'multiselectbox' => 'BP_XProfile_Field_Type_Multiselectbox',
            'number'         => 'BP_XProfile_Field_Type_Number',
            'url'            => 'BP_XProfile_Field_Type_URL',
            'radio'          => 'BP_XProfile_Field_Type_Radiobutton',
            'selectbox'      => 'BP_XProfile_Field_Type_Selectbox',
            'textarea'       => 'BP_XProfile_Field_Type_Textarea',
            'textbox'        => 'BP_XProfile_Field_Type_Profile_Textbox',
            );
            return apply_filters( 'bp_xprofile_get_field_types', $fields );
    }

    I then setup the edit.php file in my child theme folder and changed the bp_xprofile_create_field_type() function to custom_bp_xprofile_create_uprofile_field_type()

    /wp-content/themes/genbu-child/buddypress/members/single/profile/edit.php

    <?php
    //$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    $field_type = custom_bp_xprofile_create_uprofile_field_type( bp_get_the_profile_field_type() );
                                    $field_type->edit_field_html();

    When I load the profile edit screen the datebox changes came up fine but not the birthdate. When I checked the information in the custom_bp_xprofile_create_uprofile_field_type() function the [datebox] was set to “Custom_BP_XProfile_Field_Type_Profile_Datebox” but [birthdate] was still pointing to “Bxcft_Field_Type_Birthdate” even though I it was set to “Custom_Bxcft_Field_Type_Birthdate” in the custom_bp_xprofile_get_uprofile_field_types() function.

    Array
    (
        [checkbox] => BP_XProfile_Field_Type_Checkbox
        [datebox] => Custom_BP_XProfile_Field_Type_Profile_Datebox
        [birthdate] => Bxcft_Field_Type_Birthdate
        [multiselectbox] => BP_XProfile_Field_Type_Multiselectbox
        [number] => BP_XProfile_Field_Type_Number
        [url] => BP_XProfile_Field_Type_URL
        [radio] => BP_XProfile_Field_Type_Radiobutton
        [selectbox] => BP_XProfile_Field_Type_Selectbox
        [textarea] => BP_XProfile_Field_Type_Textarea
        [textbox] => BP_XProfile_Field_Type_Profile_Textbox
        [email] => Bxcft_Field_Type_Email
        [web] => Bxcft_Field_Type_Web
        [datepicker] => Bxcft_Field_Type_Datepicker
        [select_custom_post_type] => Bxcft_Field_Type_SelectCustomPostType
        [multiselect_custom_post_type] => Bxcft_Field_Type_MultiSelectCustomPostType
        [select_custom_taxonomy] => Bxcft_Field_Type_SelectCustomTaxonomy
        [multiselect_custom_taxonomy] => Bxcft_Field_Type_MultiSelectCustomTaxonomy
        [checkbox_acceptance] => Bxcft_Field_Type_CheckboxAcceptance
        [image] => Bxcft_Field_Type_Image
        [file] => Bxcft_Field_Type_File
        [color] => Bxcft_Field_Type_Color
        [decimal_number] => Bxcft_Field_Type_DecimalNumber
        [number_minmax] => Bxcft_Field_Type_NumberMinMax
        [slider] => Bxcft_Field_Type_Slider
    )

    I was able to find this filter but don’t know how to modify it…

    /wp-content/plugins/buddypress-xprofile-custom-fields-type/bp-xprofile-custom-fields-type.php

    add_filter( 'bp_xprofile_get_field_types', array($this, 'bxcft_get_field_types'), 10, 1 );
           public function bxcft_get_field_types($fields)
            {
                $new_fields = array(
                    'birthdate'                     => 'Bxcft_Field_Type_Birthdate',
                    'email'                         => 'Bxcft_Field_Type_Email',
                    'web'                           => 'Bxcft_Field_Type_Web',
                    'datepicker'                    => 'Bxcft_Field_Type_Datepicker',
                    'select_custom_post_type'       => 'Bxcft_Field_Type_SelectCustomPostType',
                    'multiselect_custom_post_type'  => 'Bxcft_Field_Type_MultiSelectCustomPostType',
                    'select_custom_taxonomy'        => 'Bxcft_Field_Type_SelectCustomTaxonomy',
                    'multiselect_custom_taxonomy'   => 'Bxcft_Field_Type_MultiSelectCustomTaxonomy',
                    'checkbox_acceptance'           => 'Bxcft_Field_Type_CheckboxAcceptance',
                    'image'                         => 'Bxcft_Field_Type_Image',
                    'file'                          => 'Bxcft_Field_Type_File',
                    'color'                         => 'Bxcft_Field_Type_Color',
                    'decimal_number'                => 'Bxcft_Field_Type_DecimalNumber',
                    'number_minmax'                 => 'Bxcft_Field_Type_NumberMinMax',
                    'slider'                        => 'Bxcft_Field_Type_Slider',
                );
                $fields = array_merge($fields, $new_fields);
    
                return $fields;
            }

    Already tried adding this to functions.php but broke all of the fields so none of them displayed

    add_filter( 'bp_xprofile_get_field_types', array($fields, 'custom_bxcft_get_field_types'), 10, 1 );
    function custom_bxcft_get_field_types($fields)
    {
               $new_fields = array(
                    'birthdate'                     => 'Custom_Bxcft_Field_Type_Birthdate',
                    'email'                         => 'Bxcft_Field_Type_Email',
                    'web'                           => 'Bxcft_Field_Type_Web',
                    'datepicker'                    => 'Bxcft_Field_Type_Datepicker',
                    'select_custom_post_type'       => 'Bxcft_Field_Type_SelectCustomPostType',
                    'multiselect_custom_post_type'  => 'Bxcft_Field_Type_MultiSelectCustomPostType',
                    'select_custom_taxonomy'        => 'Bxcft_Field_Type_SelectCustomTaxonomy',
                    'multiselect_custom_taxonomy'   => 'Bxcft_Field_Type_MultiSelectCustomTaxonomy',
                    'checkbox_acceptance'           => 'Bxcft_Field_Type_CheckboxAcceptance',
                    'image'                         => 'Bxcft_Field_Type_Image',
                    'file'                          => 'Bxcft_Field_Type_File',
                    'color'                         => 'Bxcft_Field_Type_Color',
                    'decimal_number'                => 'Bxcft_Field_Type_DecimalNumber',
                    'number_minmax'                 => 'Bxcft_Field_Type_NumberMinMax',
                    'slider'                        => 'Bxcft_Field_Type_Slider',
                );
                $fields = array_merge($fields, $new_fields);
    
                return $fields;
    }
    Thread Starter richdal

    (@richdal)

    With a little trial and error I found the change was easiest to make with jQuery. Installed the Head & Footer Code plugin to I could load my jQuery code at the end of the document and was pretty straight forward.

    I used code similar to this and was able to add different conditions to change up which image I wanted to use.

    <script type="text/javascript">
    jQuery( document ).ready( function() {
      var loc = "http:/....../logoforheader.jpg";
      jQuery( ".header-image").attr("src",loc);
    });
    </script>
    Thread Starter richdal

    (@richdal)

    I haven’t been able to find a way to modify the header-image with CSS consistently across web browsers.

    I was trying to add a condition in my theme’s functions.php file to change up the header-image in a few places. Not familiar with using the WordPress filters but is there a way to use them to change up what I get back from get_header_image() ?

    Thread Starter richdal

    (@richdal)

    Never mind I think I’m getting the Featured Image mixed up with the site logo.

    Thread Starter richdal

    (@richdal)

    Thanks for the pointer to the Dialogs tab, completely overlooked it.

    Was seeing some references to using add_filter for changing up the text but didn’t realize you had controls for some of that in the Plugins settings. Been making changes in my child theme so I haven’t made any changes with the core programs. Thanks for the help

    Thread Starter richdal

    (@richdal)

    Thanks, I may have gotten ahead of myself. I’ll check out the default configuration and see if we want to go that route instead of having the password fields on the registration form.

    Thread Starter richdal

    (@richdal)

    Thanks for the info. I was able to adjust the registration form so it only had the four fields I needed and got it working with the shortcode on the homepage. Just need to check through the other program settings and adjust the appearance. Appreciate the help.

    Thread Starter richdal

    (@richdal)

    I tried adding the [wppb-login] shortcode to the same Page and was able to login successfully. Just can’t get the registration part to work

    Thread Starter richdal

    (@richdal)

    Thanks for the reply. I need a login to get to the site so I wouldn’t have a link I could share.

    Profile Builder => General Settings
    Load Profile Builder’s own CSS file in the front-end: no
    “Email Confirmation” Activated: yes
    “Email Confirmation” Landing Page: Activate
    Allow Users to Log in With: Username and Email
    Minimum Password Length: [empty]
    Minimum Password Strength: Disabled

    Profile Builder => Admin Bar Settings
    All Default

    Pages => Home
    [wppb-register]

    If I submit an empty form I get a “404 Not Found” error. Same when the form is complete or use a duplicate username. When I checked the HTML output for that I was seeing this

    <form enctype="multipart/form-data" method="post" id="wppb-register-user" class="wppb-user-forms wppb-register-user" action="">
    			<ul><li class="wppb-form-field wppb-default-username" id="wppb-form-element-2">
    			<label for="username">Username<span class="wppb-required" title="This field is required">*</span></label>
    			<input class="text-input default_field_username" name="username" maxlength="70" id="username" value="" type="text"></li><li class="wppb-form-field wppb-default-e-mail" id="wppb-form-element-8">
    			<label for="email">Email Address<span class="wppb-required" title="This field is required">*</span></label>
    			<input class="text-input default_field_email" name="email" maxlength="70" id="email" value="" type="email"></li><li class="wppb-form-field wppb-default-password" id="wppb-form-element-12">
    			<label for="passw1">Choose a Password<span class="wppb-required" title="This field is required">*</span></label>
    			<input class="text-input" name="passw1" maxlength="70" id="passw1" value="" autocomplete="off" type="password"><span class="wppb-description-delimiter">Minimum length of 8 characters</span></li><li class="wppb-form-field wppb-default-repeat-password" id="wppb-form-element-13">
    			<label for="passw2">Confirm Password<span class="wppb-required" title="This field is required">*</span></label>
    			<input class="text-input" name="passw2" maxlength="70" id="passw2" value="" autocomplete="off" type="password"></li></ul><ul></ul>			<p class="form-submit">
    								<input name="register" id="register" class="submit button" value="Register" type="submit">
    				<input name="action" id="action" value="register" type="hidden">
    				<input name="form_name" id="form_name" value="unspecified" type="hidden">
    							</p><!-- .form-submit -->
    			<input id="register_nonce_field" name="register_nonce_field" value="2ad66287e2" type="hidden"><input name="_wp_http_referer" value="/rgsite/" type="hidden">
    </form>
    Thread Starter richdal

    (@richdal)

    Nevermind, figured it out. Missed the Layout options in the Pages configuration

    Thread Starter richdal

    (@richdal)

    Was able to figure out a way to keep the search field expanded so the icon didn’t have to clicked to open it. Looked like there was jQuery code being used to manage the effect, so I added this to my theme’s functions.php file

    function ToggleSearchOn() { ?>
    <script type="text/javascript">
    jQuery( document ).ready( function($) {
            $( ".search-toggle" ).parents( ".menu-search" ).toggleClass( "search-toggle-active" );
    </script>
    <?php
    }
    add_action( 'wp_footer', 'ToggleSearchOn' );
    Thread Starter richdal

    (@richdal)

    For the toggle I meant having to click the magnifying glass icon to show or hide the search field and its submit button. Trying to remove the effect to it’s always displaying. That way it reduces the steps for the user and easier to locate.

    I need to login to the site to access so I wouldn’t have a public access page to share. I highlighted the changes I made from the functions.php file and the CSS file it loads, but can include other parts of the code if needed.

Viewing 13 replies - 1 through 13 (of 13 total)