Tuesday, 17 September 2013

Translation function calls must NOT contain PHP variables

Translation function calls must NOT contain PHP variables

I'm using the Theme-check plugin, and it's helped me cleanup my theme
quite a bit. One of the recommended changes I make says the following:
'Possible variable $options found in translation function in
theme-options.php. Translation function calls must NOT contain PHP
variables.'
What I have is <input id='critter_theme_options[phonenumber]'
class='regular-text' type='text' name='critter_theme_options[phonenumber]'
value='<?php esc_attr_e( $options['phonenumber'] ); ?>' />
What is the correct way of saying esc_attr_e( $options['phonenumber'] );?

No comments:

Post a Comment