Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerrickhakim/85c258396491389fbfa836b4cbbb4bf7 to your computer and use it in GitHub Desktop.
Save jerrickhakim/85c258396491389fbfa836b4cbbb4bf7 to your computer and use it in GitHub Desktop.
Saving WordPress settings page with by an array
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