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'] );?


1 Solution
Solution

Here it is explained pretty good what to do, to make it work.

EDIT (from comment): So in your case

printf( "
  <input id='critter_theme_options[phonenumber]' class='regular-text' type='text' name='critter_theme_options[phonenumber]' value='%s' />",
  esc_attr( $options['phonenumber'] ) );