News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
How to Create Your Own WordPress Shortcodes
November 11, 2010 @ 08:26:36

On the SitePoint PHP blog today there's a new post showing how how to make your own "short code" system that allows for custom function execution.

WordPress doesn't normally allow you to add PHP code to pages or posts. That's for the best: you don't want clients to discover the power of the unlink function! However, you can create custom functions which are executed when a shortcode is encountered within the post text.

There's two code snippets included - one showing a simple function call, "Hello World" style, and another version that lets you define parameters to feed into the method. There's also a simple example of how you could allow them to include CSS styling into the code example too.

1 comment voice your opinion now!
wordpress shortcode tutorial function callback


blog comments powered by Disqus

Similar Posts

SecurityReason.com: PHP 5.2.4 Released...unpatched

Master Zend Framework: Running the ZF2Skeleton with PHP’s Built-in Webserver

Idrish Laxmidhar's Blog: How to send mail from Localhost with XAMPP and mercury/32

PHP-Coding-Practices.com: How To Generate Monochromatic CSS Stylesheets Within Seconds Using PHP

PHPMaster.com: Generating Invoices with Zend_Pdf


Community Events

Don't see your event here?
Let us know!


symfony2 api example php7 release voicesoftheelephpant application introduction conference interview part2 community configure library framework opinion performance podcast laravel series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework