It is possible to rename the option value 'Select Subcategory'?

  • Unknown's avatar

    Hi there,

    Is there a conditional function that would rename the option value ‘select subcategory’ if a specific term selected?

    there is the php code that display the subcategory:

    echo '<br /><span id="sub_cats">';
    if(!empty($cat[1]->term_id))
    {
    $args2 = "orderby=name&order=ASC&hide_empty=0&parent=".$cat[0]->term_id;
    $sub_terms2 = get_terms( 'auction_cat', $args2 );
    $ret = '<select class="do_input" name="subcat">';
    $ret .= '<option value="">'.__('Select Subcategory','Theme'). '</option>';
    $selected1 = $cat[1]->term_id;
    foreach ( $sub_terms2 as $sub_term2 )
    {
    $sub_id2 = $sub_term2->term_id;
    $ret .= '<option '.($selected1 == $sub_id2 ? "selected='selected'" : " " ).' value="'.$sub_id2.'">'.$sub_term2->name.'</option>';
    }
    $ret .= "</select>";
    echo $ret;																																				}
    echo '</span>';

    In human readable format, I was expecting to do something like this:

    If University category selected, rename ‘select subcategory’ to ‘select grades’

    Any help will be appreciated, Thanks in advance

  • Unknown's avatar

    Sorry but you are in the wrong forum.
    This forum is only for blogs/sites hosted by WordPress.com
    WordPress.COM and WordPress.ORG are completely separate and different http://support.wordpress.com/com-vs-org/

    And you should ask in the WordPress.org forum.
    http://wordpress.org/support/

  • The topic ‘It is possible to rename the option value 'Select Subcategory'?’ is closed to new replies.