Created
January 26, 2016 18:06
-
-
Save jdcauley/b25ffd45189c580426e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$post_types = get_post_types(array( | |
'public' => true, | |
), 'objects'); | |
foreach($post_types as $key => $value){ | |
$field_name = 'binary_stars_post_type_' . $key; | |
print_r($field_name); | |
add_settings_field( | |
$field_name, | |
__( 'Load Stars on ' . $value->labels->name, 'binary_stars' ), | |
function(){ | |
print_r($key); | |
$options = get_option( 'binary_stars_settings' ); | |
$field_name = 'binary_stars_post_type_' . $key; | |
?> | |
<input type='checkbox' name="binary_stars_settings[<?php echo $field_name; ?>]" <?php checked( $options[$field_name], 1 ); ?> value="<?php echo $key; ?>"> | |
<?php | |
}, | |
'pluginPage', | |
'binary_stars_pluginPage_section' | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment