We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

yuconner on 08/24/06


Tagged

wordpress blogs widgets


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

yuconner
jbo
webStruck_


Example code wordpress widget


Published in: PHP 


URL: http://automattic.com/code/widgets/plugins/

put "registersidebarwidget(..)" into "function widgets_init()"

  1. function widget_myuniquewidget($args) {
  2.  
  3. extract($args);
  4. ?>
  5. <?php echo $before_widget; ?>
  6. <?php echo $before_title
  7. . 'My Unique Widget'
  8. . $after_title; ?>
  9. Hello, World!
  10. <?php echo $after_widget; ?>
  11. <?php
  12.  
  13. }
  14.  
  15. register_sidebar_widget( 'My Unique Widget', 'widget_myuniquewidget' );

Report this snippet 

You need to login to post a comment.