Smashing WordPress: Beyond the Blog by Thord Daniel Hedengren

Smashing WordPress: Beyond the Blog by Thord Daniel Hedengren

Author:Thord Daniel Hedengren
Language: eng
Format: epub, pdf
Publisher: Wiley
Published: 2012-04-03T16:00:00+00:00


This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.

You should have received a copy of the GNU General Public License

along with this program; if not, write to the Free Software

Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

*/

?>

Naturally, you’d want to change YEAR, PLUGIN_AUTHOR_NAME, and PLUGIN AUTHOR E-MAIL to the correct information. You can also include the full license as a text file, aptly named license.txt of course. Obtain the license from www.gnu.org/copyleft/gpl.html.

And that’s about it. All you need for WordPress to find the plugin is this, one single file with an identifying header. Dropping it in wp-content/plugins/ will result in it being listed in the Plugins section of WordPress. Activate it from the Plugins admin page, and it will be available to you in your theme and from WordPress’s actions themselves.

This is where the fun part begins because now you have to figure out what you need to do and how you’ll accomplish it.

Whether you’re planning on writing the plugin you think will change the way you use WordPress or just need some extra functionality for your latest project, you should go through the following plugin checklist before getting started. It may just save you some time and headaches.

• Is there a plugin for this already? If there is, consider using that instead or forking/editing it if it nearly does what you want.

• Make sure that you’ve got a unique name for your plugin. Don’t just check the WordPress.org plugin directory; Google it to make sure. One way to ensure a unique name is to add your company’s initials to the front of the plugin name, such as acme_pluginname.

• Decide on a unique prefix to all your functions and stick to it. That way, you’re doing your part in eliminating any unnecessary conflicts due to a similar naming structure. This is important: Prefix everything!

• Do you want to internationalize your plugin? You really should; it works the same way as with themes and is pretty easy after all.

• Should this plugin have widget support? If it should, what kind of settings should it have?

• Do you need a Settings page within the admin interface? Try to keep settings to a minimum as they tend to confuse users.

• What license should the plugin have? Keep in mind that it has to be GPL-compatible to get hosted by the WordPress.org directory.

• Don’t forget the final check. Is the header up to date? Is the version number correct? Do all the links work? Is every necessary file in the package? And last but not least, have you spell-checked your plugin?

Methods for Incorporating Your Plugins

Writing plugins is more like traditional PHP coding than working with WordPress themes. Although you may use both template and conditional tags, most likely, you’ll be writing a lot on your own as well, not relying so much on the built-in features that WordPress tags offer you.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.