Radio Buttons not showing up as checked
<p>I'm currently trying to write a theme options page for Wordpress. In it, the user could select the alignment of the DIV through radio buttons.</p>

<p>Currently it looks like this when an option is selected: <a href="https://gyazo.com/e27c2fc2c2e1f751ab27d98453581c52" rel="nofollow">https://gyazo.com/e27c2fc2c2e1f751ab27d98453581c52</a></p>

<p>I was wondering how I'd fix that (for the radio buttons to actually show up as checked and not as checked='checked'Center). It works and it correctly outputs to front-end but it just doesn't show up as checked without the checked='checked'. If I use jquery to remove <i>checked='checked'</i> it removes the radio buttons all together.</p>

<pre><code>register_setting('slider_setting','slider_section1_direction');
add_settings_section( 'slider_section', '', 'slider_settings_callback', 'register_slider_settings' );
add_settings_field( 'slider_section1_direction', '', 'slider_section1_direction_callback', 'register_slider_settings', 'slider_section' );


function slider_section1_radio_buttons_callback() {
    $s1_radio_buttons_settings = array(
      'left' =&gt; array(
          'value' =&gt; 'left',
          'label' =&gt; 'Left'
        ),
      'center' =&gt; array(
          'value' =&gt; 'center',
          'label' =&gt; 'Center'
        ),
      'right' =&gt; array(
          'value' =&gt; 'right',
          'label' =&gt; 'Right'
        ),
    );

  return apply_filters( 'slider_section1_radio_buttons_callback', $s1_radio_buttons_settings );
  }

  function slider_section1_direction_callback() {
    $settings = get_option('slider_section1_direction');
    echo '&lt;div class="setting"&gt;';
    echo '&lt;div class="setting-header half-width-header"&gt;';
    esc_attr_e('Slider Text Alignment');
    echo '&lt;/div&gt;';
    echo '&lt;div class="setting-body" style="margin-top: 5px"&gt;';

    // RADIO BUTTONS
    foreach ( slider_section1_radio_buttons_callback() as $s1_button ) {
      echo '&lt;label class="description" style="margin-right: 40px"&gt;';
        echo "&lt;input type='radio'" . checked( $settings['s1_radio_buttons_settings'], $s1_button['value'] ) . " name='slider_section1_direction[s1_radio_buttons_settings]' value='" . esc_attr( $s1_button['value'] ) . "'/&gt;";
        echo $s1_button['label'];
      echo '&lt;/label&gt;';
    }

    echo '&lt;/div&gt;';
    echo '&lt;div class="clear"&gt;&lt;/div&gt;';
    echo '&lt;/div&gt;';
  }

 function slider_settings_callback() {
     }
</code></pre>

<p>Thanks!</p>