plug_custom_header.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. if (!class_exists("plug_custom_header")) {
  3. class plug_custom_header {
  4. function __construct($ns) {
  5. $this->title = __("Custom Header Code","dagsopt");
  6. $this->pluginname = $ns->pluginname;
  7. $this->file = $ns->file;
  8. $this->ns = $ns;
  9. }
  10. function start() {
  11. add_action('wp_head',array(&$this,'header'),1);
  12. }
  13. function header() {
  14. if(get_option($this->pluginname."_custom_header") == "on"){
  15. $data = get_option($this->pluginname."_custom_header_data");
  16. echo( stripcslashes($data) );
  17. };
  18. }
  19. function help(){
  20. ?>
  21. <?php echo(__("Adds code in the head ","dagsopt")) ?>
  22. <?php
  23. }
  24. function Option($pre){
  25. update_option ( $pre.'_data', $_POST [ $pre.'_data' ] );
  26. }
  27. function admin_line($pre){
  28. ?>
  29. <?php echo(__("Custom data:","dagsopt")) ?><br><textarea name="<?php echo( $pre.'_data' ); ?>"><?php echo(stripcslashes(get_option($pre."_data"))); ?></textarea> <br>
  30. <?php
  31. }
  32. }
  33. global $plug_custom_header;
  34. $plug_custom_header = new plug_custom_header($this);
  35. $this->dagsopt['plug_custom_header'] = $plug_custom_header;
  36. }