Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function logo_display()
  2. {
  3. ?>
  4. <input type="file" name="logo" />
  5. <?php echo get_option('logo'); ?>
  6. <?php
  7. }
  8. function handle_logo_upload()
  9. {
  10. if(!empty($_FILES["demo-file"]["tmp_name"]))
  11. {
  12. $urls = wp_handle_upload($_FILES["logo"], array('test_form' => FALSE));
  13. $temp = $urls["url"];
  14. return $temp;
  15. }
  16. return $option;
  17. }
  18. function display_theme_panel_fields()
  19. {
  20. add_settings_section("section", "All Settings", null, "theme-options");
  21. add_settings_field("logo", "Logo", "logo_display", "theme-options", "section");
  22. register_setting("section", "logo", "handle_logo_upload");
  23. }
  24. add_action("admin_init", "display_theme_panel_fields");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement