Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Functions you'll need to call.
- /**
- * PHP5 constructor
- *
- * @param string $id_base Optional Base ID for the widget, lower case,
- * if left empty a portion of the widget's class name will be used. Has to be unique.
- * @param string $name Name for the widget displayed on the configuration page.
- * @param array $widget_options Optional Passed to wp_register_sidebar_widget()
- * - description: shown on the configuration page
- * - classname
- * @param array $control_options Optional Passed to wp_register_widget_control()
- * - width: required if more than 250px
- * - height: currently not used but may be needed in the future
- */
- function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
- $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
- $this->name = $name;
- $this->option_name = 'widget_' . $this->id_base;
- $this->widget_options = wp_parse_args( $widget_options, array('classname' => $this->option_name) );
- $this->control_options = wp_parse_args( $control_options, array('id_base' => $this->id_base) );
- }
- /**
- * PHP4 constructor
- */
- function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
- WP_Widget::__construct( $id_base, $name, $widget_options, $control_options );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement