Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. function example_customizer( $wp_customize ) {
  2.  
  3. $wp_customize->add_section(
  4. 'example_section_one',
  5. array(
  6. 'title' => 'Example Settings',
  7. 'description' => 'This is a settings section.',
  8. 'priority' => 35,
  9. )
  10. );
  11.  
  12. $wp_customize->add_setting(
  13. 'select_revslider',
  14. array(
  15. 'default' => 'wordpress',
  16. )
  17. );
  18.  
  19.  
  20. $wp_customize->add_control(
  21. 'select_revslider',
  22. array(
  23. 'type' => 'select',
  24. 'label' => 'Please Select a Slider:',
  25. 'section' => 'example_section_one',
  26. 'choices' => array(
  27. 'wordpress' => 'WordPress',
  28. ),
  29. )
  30. );
  31.  
  32. <?php
  33.  
  34. global $wpdb; //Accessing WP Database (non-WP Table) use code below.
  35.  
  36. $results = $wpdb->get_results('SELECT alias FROM wp_revslider_sliders');
  37.  
  38. foreach ($results as $result) {
  39. $revchoices = array("text" => $result, "value" => $result);
  40. }
  41.  
  42. return $revchoices;
  43.  
  44. ?>
  45.  
  46. $wp_customize->add_control(
  47. 'select_revslider',
  48. array(
  49. 'type' => 'select',
  50. 'label' => 'Please Select a Slider:',
  51. 'section' => 'example_section_one',
  52. 'choices' => include('jktestrev.php'),
  53. )
  54. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement