Created
June 20, 2018 04:56
-
-
Save jerrickhakim/85c258396491389fbfa836b4cbbb4bf7 to your computer and use it in GitHub Desktop.
Saving WordPress settings page with by an array
This file contains 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
function wpca_sales_feed_save_settings(){ | |
$wpca_sales_feed_save = array( | |
'wpca_show_for_logged_users', | |
'wpca_feed_begin', | |
'wpca_feed_begin', | |
'wpca_feed_show_for', | |
'wpca_cards_per_user', | |
'sales_feed_in_animation', | |
'sales_feed_out_animation', | |
'wpca_session_reset', | |
'sales_feed_post', | |
'wpca_sales_feed_message', | |
'sales_feed_pages', | |
'wpca_feed_delay' | |
); | |
foreach ($wpca_sales_feed_save as $wpca_sales_feed_save => $setting) { | |
register_setting( 'wpca-sales-feed-settings', $setting, 'wpca_feed_sanitize_license' ); | |
} | |
} | |
add_action('admin_init', 'wpca_sales_feed_save_settings'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment