Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am building a form where a user can submit an article from the front end..

So far so good... To this form i am doing some submission check using javascript..

When i get to check if a category is choosen

This is the line the retrives categories in the form:

<?php wp_dropdown_categories('show_option_none=---------------->&taxonomy=category&hide_empty=0&name=cats[]&orderby=name&hierarchical=1'); ?>

I dont know how to check it.. what is the value being sent to wordpress? Also.. Can i change this:

show_option_none=---------------->

into somthing i can translate using the regular tranlation method aka __() or _e()??

Thanks guys

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Ok... as thing go when your trying to solve somethimg you have no peace until its fixed so.. i went ahead and did some clear mind thinking (after a night sleep) and got that i can check the HTML for the values returen.

Just wanted to share incase anyone stumbles with the need for this info

This:<?php wp_dropdown_categories('show_option_none=---------------->&taxonomy=category&hide_empty=0&name=cats[]&orderby=name&hierarchical=1'); ?>

Returns a value of the category number for each select item which is easy to check.

Also.. about the translation part this is the right way to do that..

<?php 
$choosecatmsg = __('Choose A Category', 'blue_article_demon');                      
wp_dropdown_categories('show_option_none='.$choosecatmsg.'&taxonomy=category&hide_empty=0&name=cats[]&orderby=name&hierarchical=1');
?>

Thanks for anyone who took a look while i was stuck :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.