Skip to content

Instantly share code, notes, and snippets.

@designbuildtest
Created September 30, 2015 03:53
Show Gist options
  • Save designbuildtest/48362ae08b602bce1747 to your computer and use it in GitHub Desktop.
Save designbuildtest/48362ae08b602bce1747 to your computer and use it in GitHub Desktop.
Miscellaneous settings
<?php
/**
* Miscellaneous
*
*/
$advanced_count = 10;
$advanced_array = array(
__( 'Google Analytics Tracking Code' ) => 'dbt_google_analytics_code',
//__( 'Facebook Comments App ID' ) => 'dbt_facebook_comments_app_id',
//__( 'Disqus Shortname' ) => 'dbt_disqus_shortname',
//__( 'Timely' ) => 'dbt_timely',
);
foreach ( $advanced_array as $key => $value ) {
$wp_customize->add_setting( $value, array(
'type' => 'option',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( $value, array(
'section' => 'dbt_settings',
'label' => $key,
'priority' => $advanced_count++,
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment