This topic has 19 replies, 3 voices, and was last updated 5 years by Radu.

  • Author
  • #217714
     webdev159
    Participant

    changed: http://prntscr.com/mcepvx but 2019 is not shown: http://prntscr.com/mceqj8 ie necessary so that the candidate could enter the date of birth of his child

    #217743
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #217784
     webdev159
    Participant

    Ok.
    Thanks!

    #217801
     Radu
    Moderator

    Hi,

    If you set 0 for both values , like to de-activate them to test it behaves correctly ?

    Let me know

    Make sure to have latest theme update and latest plugin versions installed.

    Also if you deactivate the child theme it will behaves normally ?

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #217824
     webdev159
    Participant

    “If you set 0 for both values , like to de-activate them to test it behaves correctly ?” – if set to “0”, 2001 remains the latest

    “Make sure to have latest theme update and latest plugin versions installed.” – for some reason, a notification about the availability of a new version of a theme does not come, for what reason is this happening?

    “Also if you deactivate the child theme it will behaves normally ?” – Why do I need to deactivate the child theme?

    #218018
     Radu
    Moderator

    Hi,

    1. So it behaves as it should if you remove the limits?

    2. If you already have the latest theme version installed it will not appears, so you don’t have it ? Update it.

    3. If you had made any php modification related to the buddy-press or similar it may interact with that, depends what more exactly. That’s it’s better to try to make sure if it’s a general theme issue or a isolated one.

    Let me know

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218030
     webdev159
    Participant

    1. Limits off, situation no change, unfortunately
    2. My theme version: http://prntscr.com/mgh8oz
    3. even bp-custom.php was deactivated, for the purity of the experiment, no change

    P.s. all this time active General theme

    #218332
     Radu
    Moderator

    Hi,

    Using the next snippet will make the registration to starts from 13, you can change 3 with 17 to start from 1 year

    COPY CODE
    
    
    function my_custom_bp_datebox($html, $type, $day, $month, $year, $field_id, $date) {
        $current_year = date("Y");
        $allowed_year = $current_year - 13;
        if($type == 'year'){
       
            $html = '<option value=""' . selected( $year, '', false ) . '>----</option>';
    
            for ( $i = $allowed_year; $i >= 1920; $i-- ) {
                    $html .= '<option value="' . $i .'"' . selected( $year, $i, false ) . '>' . $i . '</option>';
            }
        }
        return $html;
    }
    add_filter( 'bp_get_the_profile_field_datebox', 'my_custom_bp_datebox',10,7);
    

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218349
     webdev159
    Participant

    Radu hi,
    Thanks for some custom code, very appreciate for this.

    I registered it in the child theme.
    Found this drop-down list: http://prntscr.com/mjmvs5
    Orient, please, how to manage it so it is not quite clear.

    Thank you.

    #218394
     Radu
    Moderator

    The field that will be used to display ages and also when it converts from birthday to age.

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218478
     webdev159
    Participant

    Ok,
    Could you explain how to set this option to get the necessary result?
    I would be very grateful to you.

    #218491
     Radu
    Moderator

    Hi, Yes what you need to achieve ? What’s your necessary result ? The field description says “Select you Age field. This is used to calculate members age” So that may be used to transform the birthday to ages.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218492
     webdev159
    Participant

    Ok,
    I need that`s user can set date birthday of Child’s birthday (1), Child’s birthday (1)
    But users can’t set Date of Childbirth, example 3 years old, because of the final year is 2001: http://prntscr.com/mkmyk4

    #218545
     Radu
    Moderator

    Hi,

    The snippet from there it should hack that limit : https://archived.seventhqueen.com/forums/topic/kids-date-of-birth/#post-218332

    So, if you will apply that you should not have the issue with age selection on date fields.

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218586
     webdev159
    Participant

    Rephrase, unfortunately, I do not understand you.
    What needs to be configured in the admin panel so that the result is needed?

    P.S. the code that you sent is installed.

    #218635
     Radu
    Moderator

    Hi,

    I wanted to say that using that snippet your current issue should be resolved. In the admin panel don’t not needed to do nothing, just add the snippet and the birthdate field should offer you the possibility to select birthday ages under 18

    So the code works, i’ve tested it and that removes and fixes the issue that you report (with the age limit)

    COPY CODE
    
    function my_custom_bp_datebox($html, $type, $day, $month, $year, $field_id, $date) {
        $current_year = date("Y");
        $allowed_year = $current_year - 1;
        if($type == 'year'){
    
            $html = '<option value=""' . selected( $year, '', false ) . '>----</option>';
    
            for ( $i = $allowed_year; $i >= 1920; $i-- ) {
                $html .= '<option value="' . $i .'"' . selected( $year, $i, false ) . '>' . $i . '</option>';
            }
        }
        return $html;
    }
    add_filter( 'bp_get_the_profile_field_datebox', 'my_custom_bp_datebox',11,7);
    
    

    So use this instead it may be something wit the priorities attribute, in the initial function it’s 10 now 11, both works for me, you try to test with 11 it should work!!!!

    I will edit also the initial reply with the 10 priority after you confirm also that it works, maybe some user search for it.

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218659
     webdev159
    Participant

    Radu hi,
    do I understand correctly, if I integrating this snippet into the Child theme in functions.php I`ll have access to setting the Child’s birthday in this field: http://prntscr.com/mlmcfv if the child is a year(2019) or two(2018)?

    Thanks!

    #218815
     Radu
    Moderator

    That snippet just remove this limit (see screenshot) so that resulting that there will not be any age limit for registering.

    Yes

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #218920
     webdev159
    Participant

    Ok,
    but I need to lift the restriction on the established year of birth: http://prntscr.com/moyr6f

    All without changes, I can not set a year-old child the year of his birth 2018, sincerely hope that you understand what I mean.

    #218970
     Radu
    Moderator

    I’ve offered a snippet that handles that, tested 3 times and ti removes the limit

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 20 posts - 1 through 20 (of 20 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?