Forum Replies Created
-
Author
-
mrmalmgrenParticipant
Hi,
Added the code to the child, (see below), but it seems that the code is not accepted (it shows in the top of the admin area of wordpress)
What am I doing wrong?
Thanks
<?php
/**
* @package WordPress
* @subpackage Sweetdate
* @author SeventhQueen <themesupport@seventhqueen.com>
* @since Sweetdate 1.0
*//**
* Sweetdate Child Theme Functions
* Add extra code or replace existing functions
*/?>
add_action(‘after_setup_theme’,’kleo_my_age’);
function kleo_my_age()
{
remove_filter( ‘bp_get_the_profile_field_datebox’, ‘custom_bp_datebox’,10,7);
add_filter( ‘bp_get_the_profile_field_datebox’, ‘my_age_range’,10,7);
}/**
* Filter year field only to allow minimum 18 year old members
*/
function my_age_range($html, $type, $day, $month, $year, $field_id, $date) {
$current_year = date(“Y”);
$allowed_year = $current_year – 14;
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;
}mrmalmgrenParticipantthink I got a lot working, but cant figure out this:
would like to add a “hcp field”, acting like an “age field”. Looking for a… with the hcp between x and y.
thanks 🙂
-
AuthorPosts