emka.web.id

hadapi dengan tenang jiwa, semua akan baik-baik saja


Pada tutorial kali ini, secara singkat akan diuraikan tentang ciri utama sebuah plugin WordPress, yaitu header. Setiap file PHP yang merupakan plugin WordPress akan dicirikan dengan keberadaan header.

Semua source code dapat anda unduh disini, namun anda disarankan untuk tetap membaca penjabarannya disini. Silakan baca tutorial sebelumnya untuk mengenal apa itu plugin, konsep dan saran pembuatan struktur folder plugin WordPress.

Contoh header sebuah plugin misalnya:

<?php
/*
Plugin Name: Akismet
Plugin URI: http://akismet.com/?return=true
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="admin.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
Version: 2.5.5
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
License: GPLv2 or later
*/
?>

Sourcecode diatas adalah header dari plugin Akismet, anda bisa mengecek dan membuka contohnya pada /wp-content/plugins/akismet/akismet.php.

Sebagai latihan, silakan buat perencanaan sebuah plugin WordPress. Contohnya plugin Sistem Informasi Sekolah:

<?php
/*
Plugin Name: Sistem Informasi Akademik Sekolah (siaSekolah)
Plugin URI: http://sisteminformasi.web.id/siasekolah/
Description: Sistem informasi akademik sekolah (SMP-SMA Sederajat), modular, fleksibel, lengkap dan aplikatif.
Version: 1.0
Author: Luthfi Maslichul Kurniawan
Author URI: http://luthfi.emka.web.id/
/* ----------------------------------------------*/
?>

Simpan sourcecode tersebut pada folder /wp-content/plugins/sis/siasekolah.php.

Install Plugin SIS

Silakan login ke WordPress anda, dan tuju ke halaman Plugins. Seharusnya plugin Sistem Informasi Akademik Sekolah (siaSekolah) sudah muncul.

Screenshoot:

Nah, saya harap contoh ini sudah bisa memberi gambaran bagaimana awal membuat plugin WordPress. Pada tutorial selanjutnya, kita akan mencoba membuat plugin WordPress sederhana.

Incoming search terms:

Tulisan Menarik Lainnya


No Comments on “Belajar WordPress: Tutorial Membuat Plugin (3)”

You can track this conversation through its atom feed.

No one has commented on this entry yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>