Parcourir la source

Merge pull request #676 from joeguilmette/Customize

Add support to modify WP Customize default sections
Eddie Machado il y a 11 ans
Parent
commit
66af143faf
1 fichiers modifiés avec 37 ajouts et 0 suppressions
  1. 37 0
      functions.php

+ 37 - 0
functions.php

@@ -113,6 +113,43 @@ duplicate one of the lines in the array and name it according to your
 new image size.
 */
 
+/************* THEME CUSTOMIZE *********************/
+
+/* 
+  A good tutorial for creating your own Sections, Controls and Settings:
+  http://code.tutsplus.com/series/a-guide-to-the-wordpress-theme-customizer--wp-33722
+  
+  Good articles on modifying the default options:
+  http://natko.com/changing-default-wordpress-theme-customization-api-sections/
+  http://code.tutsplus.com/tutorials/digging-into-the-theme-customizer-components--wp-27162
+  
+  To do:
+  - Create a js for the postmessage transport method
+  - Create some sanitize functions to sanitize inputs
+  - Create some boilerplate Sections, Controls and Settings
+*/
+
+function bones_theme_customizer($wp_customize) {
+  // $wp_customize calls go here.
+  //
+  // Uncomment the below lines to remove the default customize sections 
+
+  // $wp_customize->remove_section('title_tagline');
+  // $wp_customize->remove_section('colors');
+  // $wp_customize->remove_section('background_image');
+  // $wp_customize->remove_section('static_front_page');
+  // $wp_customize->remove_section('nav');
+
+  // Uncomment the below lines to remove the default controls
+  // $wp_customize->remove_control('blogdescription');
+  
+  // Uncomment the following to change the default section titles
+  // $wp_customize->get_section('colors')->title = __( 'Theme Colors' );
+  // $wp_customize->get_section('background_image')->title = __( 'Images' );
+}
+
+add_action( 'customize_register', 'bones_theme_customizer' );
+
 /************* ACTIVE SIDEBARS ********************/
 
 // Sidebars & Widgetizes Areas