Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. /**
  2. * Add page selector to the customizer.
  3. *
  4. * @since Theme 1.0.0
  5. *
  6. * @param WP_Customize_Manager $wp_customize Customizer object.
  7. */
  8. function prefix_customize_register( $wp_customize ) {
  9.  
  10. $wp_customize->add_section( 'showcase' , array(
  11. 'title' => __( 'Showcase', 'textdomain' ),
  12. 'priority' => 30,
  13. ) );
  14.  
  15. for ( $count = 1; $count <= 4; $count++ ) {
  16.  
  17. // Add color scheme setting and control.
  18. $wp_customize->add_setting( 'showcase-page-' . $count, array(
  19. 'default' => '',
  20. 'sanitize_callback' => 'absint'
  21. ) );
  22.  
  23. $wp_customize->add_control( 'showcase-page-' . $count, array(
  24. 'label' => __( 'Select Page', 'textdomain' ),
  25. 'section' => 'showcase',
  26. 'type' => 'dropdown-pages'
  27. ) );
  28.  
  29. }
  30.  
  31. }
  32. add_action( 'customize_register', 'prefix_customize_register' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement