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've seen in various tutorials where people white the custom field Name in this fashion: intro-image. I thought I would make more sense to use (user friendly names instead of something that looks like a variable).

Is using hyphen (or underscore) a good practice?

share|improve this question
add comment

2 Answers

I have always use "custom_field_name" and never had any problems with that but i guess that with a more user friendly approach "Custom Field Name" you could run into wired problems.

share|improve this answer
add comment

You can use spaces and uppercase chars(periods, commas, and more) without worry. Only time you'll see any problems is with register_globals on(strict array key names when enabled), but who has it enabled these days?

Any of these should be fine as custom field names.

  • My Image
  • My.Field
  • 112,Hello

Use whichever you prefer.. :)

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.