WordPress Plugin: Determining the Plugin Path

  • Post author:
  • Post category:Wordpress

Often you need to determine fi le and folder paths within your plugins. For example, you might have an image in your plugin folder that you want to display. Generally speaking, it isn ’ t a good idea to hardcode a directory path in a plugin. WordPress can be confi gured to run in a million different ways, so assuming you know the proper directory paths is a mistake. This section looks at the proper way to determine fi le and folder paths in your WordPress plugin.

A common task in any plugin is referencing fi les and folders in your WordPress installation. You can reference fi les in your code in two ways: using the local server path or by using a standard URL. (more…)

Continue ReadingWordPress Plugin: Determining the Plugin Path

Belajar WordPress: Tutorial Membuat Plugin (3)

  • Post author:
  • Post category:Wordpress

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: (more…)

Continue ReadingBelajar WordPress: Tutorial Membuat Plugin (3)