Advertisement
onzulin

customize api

Dec 29th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.94 KB | None | 0 0
  1.  public function customTheme()
  2.         {
  3.             //Logo on the web
  4.             $wp_customize->add_section("Logo", array(
  5.                 "title" => __("Change logo", "customizer_logo_sections"),
  6.                 "priority" => 30,
  7.             ));
  8.             $wp_customize->add_setting("Change_logo", array(
  9.                 "default" => "",
  10.                 "transport" => "postMessage",
  11.             ));
  12.             $wp_customize->add_control(new WP_Customize_Control(
  13.                 $wp_customize,
  14.                 "Change_logo",
  15.                 array(
  16.                     "label" => __("Enter Ads Code", "customizer_ads_code_label"),
  17.                     "section" => "Logo",
  18.                     "settings" => "Change_logo",
  19.                     "type" => "select"
  20.                 )
  21.             ));
  22.             //$wp_customize->get_setting('ads_code')->transport = 'refresh';
  23.             $wp_customize->get_setting('Change_logo')->transport = 'postMessage';
  24.             //to try some problem
  25.             $wp_customize->add_section("Navbarbrand", array(
  26.                 "title" => __("Change Navbarbrand", "customizer_logo_sections"),
  27.                 "priority" => 30,
  28.             ));
  29.             $wp_customize->add_setting("Change_navbarbrand", array(
  30.                 "default" => "",
  31.                 "transport" => "postMessage",
  32.             ));
  33.             $wp_customize->add_control(new WP_Customize_Control(
  34.                 $wp_customize,
  35.                 "Change_navbarbrand",
  36.                 array(
  37.                     "label" => __("Enter Navbarbrand", "customizer_navbarbrand_label"),
  38.                     "section" => "Navbarbrand",
  39.                     "settings" => "Change_navbarbrand",
  40.                     "type" => "text"
  41.                 )
  42.             ));
  43.             //$wp_customize->get_setting('ads_code')->transport = 'refresh';
  44.             $wp_customize->get_setting('Change_navbarbrand')->transport = 'postMessage';
  45.  
  46.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement