Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When i submit my options, in the Theme Options page of my custom theme, it saves also empty text fields.

E.G.:

sample_theme_options => array(
   text_field_1 = '',
   text_field_2 = 'blah blah'
 )

How can I filter text fields, deleting empty ones?

share|improve this question
use the native array_filter( $array ); to get rid of empty/false/null values. – kaiser Sep 25 '12 at 1:18

closed as too localized by Brian Fegter, kaiser, toscho Oct 3 '12 at 3:38

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.