Seite 273/274

11 Eigene Plugins für WordPress

11.6 Widget erstellen, Seite 272


class My_Widget extends WP_Widget {

	function My_Widget() {
		// Konstruktor
	}

	function widget($args, $instance) {
		// Ausgabefunktion
	}

	function update($new_instance, $old_instance) {
		// Speichern des Widgets
	}

	function form($instance) {
		// Widgetform im Backend
	}

}

register_widget('My_Widget');

PHP-Datei widget-api.phps 2 kByte

PHP-Datei widget-api.php 900 Byte

Die Kommentarfunktion ist geschlossen.