mattiasghodsian / wp_theme_settings

A custom WordPress class for creating theme settings page

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

empty() and esc_attr()

ianzablovschii opened this issue · comments

commented

empty() needs to access the value by reference (in order to check whether that reference points to something that exists), but PHP before 5.5 didn't support references to temporary values returned from functions.

Empty is just an alias for !isset($thing) || !$thing. When the thing you're checking always exists (in PHP results of function calls always exist), the empty() function is nothing but a negation operator.

Remove empty() in wp_theme_settings.php, line 166 and 173:

'.((esc_attr(get_option($array['name']))) ? 'checked="checked" ' : '').'