WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin...
Transcript of WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin...
![Page 1: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/1.jpg)
WordPressplugin development
(with pictures)
Simon Wheatleywww.simonwheatley.co.uk
![Page 2: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/2.jpg)
WordPressplugin development
(with pictures)
Simon Wheatleywww.simonwheatley.co.uk
![Page 3: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/3.jpg)
plugins
photo by djking
![Page 4: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/4.jpg)
anatomy of a plugin file?
photo by striatic
![Page 5: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/5.jpg)
<?php
/*Plugin Name: Flickr InsertPlugin URI: http://www.simonwheatley.co.uk/wordpress/Version: 1.0Description: Allows you to embed Flickr photos and photosets.Author: Simon WheatleyAuthor URI: http://www.simonwheatley.co.uk/
Copyright 2007 Simon Wheatley
(any licensing legal gubbins.)*/
?>
![Page 6: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/6.jpg)
![Page 7: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/7.jpg)
<?php
/*Plugin Name: Flickr Insert*/
?>
![Page 9: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/9.jpg)
filters
photo by BlueskyPol
![Page 10: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/10.jpg)
actions
![Page 11: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/11.jpg)
![Page 12: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/12.jpg)
function bi_insert_bg_css() {$img_id = bi_get_bg_img_id();$img_path = bi_img_path( $img_id );
$css = "<style type='text/css'>\n";$css .= "body {\n";$css .= "background-image: url($img_path)\n”";$css .= "}\n";$css .= "</style>\n";
echo $css;}
add_action('wp_head', 'bi_insert_bg_css');
![Page 13: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/13.jpg)
function names
photo by birdyboo
![Page 14: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/14.jpg)
function bi_insert_bg_css() {$img_id = bi_get_bg_img_id();$img_path = bi_img_path( $img_id );
$css = "<style type='text/css'>\n";$css .= "body {\n";$css .= "background-image: url($img_path)\n”";$css .= "}\n";$css .= "</style>\n";
echo $css;}
add_action('wp_head', 'bi_insert_bg_css');
![Page 15: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/15.jpg)
function bi_insert_bg_css() {$img_id = bi_get_bg_img_id();$img_path = bi_img_path( $img_id );
$css = "<style type='text/css'>\n";$css .= "body {\n";$css .= "background-image: url($img_path)\n”";$css .= "}\n";$css .= "</style>\n";
echo $css;}
add_action('wp_head', 'bi_insert_bg_css');
![Page 16: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/16.jpg)
filters
![Page 17: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/17.jpg)
![Page 18: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/18.jpg)
function ep_exclude_pages( $pages ){$excluded_ids = ep_get_excluded_ids();$length = count( $pages );for ( $i=0; $i<$length; $i++ ) { $page = & $pages[$i]; if ( in_array( $page->ID, $excluded_ids ) ) { unset( $pages[$i] ); }}// Reindex the array, for neatness$pages = array_values( $pages );return $pages;}
add_filter('get_pages','ep_exclude_pages');
![Page 19: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/19.jpg)
function ep_exclude_pages( $pages ){$excluded_ids = ep_get_excluded_ids();$length = count( $pages );for ( $i=0; $i<$length; $i++ ) { $page = & $pages[$i]; if ( in_array( $page->ID, $excluded_ids ) ) { unset( $pages[$i] ); }}// Reindex the array, for neatness$pages = array_values( $pages );return $pages;}
add_filter('get_pages','ep_exclude_pages');
![Page 20: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/20.jpg)
function ep_exclude_pages( $pages ){$excluded_ids = ep_get_excluded_ids();$length = count( $pages );for ( $i=0; $i<$length; $i++ ) { $page = & $pages[$i]; if ( in_array( $page->ID, $excluded_ids ) ) { unset( $pages[$i] ); }}// Reindex the array, for neatness$pages = array_values( $pages );return $pages;}
add_filter('get_pages','ep_exclude_pages');
![Page 21: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/21.jpg)
actions
![Page 22: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/22.jpg)
filters
![Page 23: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/23.jpg)
![Page 24: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/24.jpg)
![Page 25: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/25.jpg)
![Page 26: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/26.jpg)
![Page 27: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/27.jpg)
![Page 28: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/28.jpg)
![Page 29: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/29.jpg)
the editor
photo by thetourise
![Page 30: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/30.jpg)
adding TinyMCE buttons
photo by Thomas Hawk
![Page 31: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/31.jpg)
![Page 32: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/32.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_mce_external_plugins( $plugins ) {$plugins['flickr'] = get_bloginfo('wpurl') . FI_WEB_PATH . '/tinymce/editor_plugin.js';return $plugins;}function fi_addbuttons() {if ( ! current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;if ( ! get_user_option('rich_editing') ) return;add_filter( 'mce_external_plugins', 'fi_mce_external_plugins' );}
add_action('init', 'fi_addbuttons' );
![Page 33: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/33.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_mce_external_plugins( $plugins ) {$plugins['flickr'] = get_bloginfo('wpurl') . FI_WEB_PATH . '/tinymce/editor_plugin.js';return $plugins;}function fi_addbuttons() {if ( ! current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;if ( ! get_user_option('rich_editing') ) return;add_filter( 'mce_external_plugins', 'fi_mce_external_plugins' );}
add_action('init', 'fi_addbuttons' );
![Page 34: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/34.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_mce_external_plugins( $plugins ) {$plugins['flickr'] = get_bloginfo('wpurl') . FI_WEB_PATH . '/tinymce/editor_plugin.js';return $plugins;}function fi_addbuttons() {if ( ! current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;if ( ! get_user_option('rich_editing') ) return;add_filter( 'mce_external_plugins', 'fi_mce_external_plugins' );}
add_action('init', 'fi_addbuttons' );
![Page 35: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/35.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_mce_external_plugins( $plugins ) {$plugins['flickr'] = get_bloginfo('wpurl') . FI_WEB_PATH . '/tinymce/editor_plugin.js';return $plugins;}function fi_addbuttons() {if ( ! current_user_can('edit_posts') && !current_user_can('edit_pages') ) return;if ( ! get_user_option('rich_editing') ) return;add_filter( 'mce_external_plugins', 'fi_mce_external_plugins' );}
add_action('init', 'fi_addbuttons' );
![Page 36: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/36.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addButton('flickr', { title : 'flickr.desc', cmd : 'mceFlickr', image : url + '/img/flickr.gif' });ed.onNodeChange.add(function(ed, cm, n) {cm.setActive('flickr', n.nodeName == 'IMG');});}
tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 37: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/37.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addButton('flickr', { title : 'flickr.desc', cmd : 'mceFlickr', image : url + '/img/flickr.gif' });ed.onNodeChange.add(function(ed, cm, n) {cm.setActive('flickr', n.nodeName == 'IMG');});}
tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 38: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/38.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addButton('flickr', { title : 'flickr.desc', cmd : 'mceFlickr', image : url + '/img/flickr.gif' });ed.onNodeChange.add(function(ed, cm, n) {cm.setActive('flickr', n.nodeName == 'IMG');});}
tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 39: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/39.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addButton('flickr', { title : 'flickr.desc', cmd : 'mceFlickr', image : url + '/img/flickr.gif' });ed.onNodeChange.add(function(ed, cm, n) {cm.setActive('flickr', n.nodeName == 'IMG');});}
tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 40: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/40.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addButton('flickr', { title : 'flickr.desc', cmd : 'mceFlickr', image : url + '/img/flickr.gif' });ed.onNodeChange.add(function(ed, cm, n) {cm.setActive('flickr', n.nodeName == 'IMG');});}
tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 41: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/41.jpg)
popup dialog
photo by Kiff ta race / undercensure
![Page 42: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/42.jpg)
![Page 43: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/43.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addButton('flickr', { title : 'flickr.desc', cmd : 'mceFlickr', image : url + '/img/flickr.gif' });ed.onNodeChange.add(function(ed, cm, n) {cm.setActive('flickr', n.nodeName == 'IMG');});}
tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 44: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/44.jpg)
ed.addCommand('mceFlickr', function() { ed.windowManager.open({ file : url + '/../../../../wp-admin/?fi_dialog=1', width : 640 + parseInt(ed.getLang('flickr.delta_width', 0)), height : 430 + parseInt(ed.getLang('flickr.delta_height', 0)), inline : 1}, { plugin_url : url });});
![Page 45: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/45.jpg)
(function() { tinymce.PluginManager.requireLangPack('flickr');tinymce.create('tinymce.plugins.FlickrInsert', {init : function(ed, url) {ed.addCommand('mceFlickr', function() { ed.windowManager.open({ file : url + '/../../../../wp-admin/?fi_dialog=1', width : 640 + parseInt(ed.getLang('flickr.delta_width', 0)), height : 430 + parseInt(ed.getLang('flickr.delta_height', 0)), inline : 1}, { plugin_url : url });});}tinymce.PluginManager.add('flickr', tinymce.plugins.FlickrInsert);})();
![Page 46: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/46.jpg)
![Page 47: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/47.jpg)
forms
photo by source
![Page 48: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/48.jpg)
function fi_photo_query() { $fi_photo = @ $_GET['fi_photo']; if ( ! $fi_photo ) return; $f = & fi_flickr(); $fi_photo_id = @ $_GET['fi_photo_id']; $photo = $f->photos_getInfo( $fi_photo_id ); $href = $f->buildPhotoURL($photo, "medium"); $src = $f->buildPhotoURL($photo, "small"); $alt = addslashes( $photo['title'] ); $data = array( 'href' => $href, 'src' => $src, 'alt' => $alt ); $json = new Moxiecode_JSON(); echo $json->encode( $data ); exit;}
// Answer various AJAX queriesadd_action('init', 'fi_photo_query', -10 );
![Page 49: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/49.jpg)
require_once( ABSPATH . "/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php" );
![Page 50: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/50.jpg)
![Page 51: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/51.jpg)
shortcodes
photo by thetourise
![Page 52: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/52.jpg)
[flickr-photoset]http://flickr.com/photos/colonelkillgore/sets/72157594553989524/[/flickr-photoset]
![Page 53: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/53.jpg)
// Parse the photoset shortcodefunction fi_shortcode( $atts, $content ) { $photoset_id = fi_photoset_id( $content ); $html = fi_photoset( $photoset_id ); return $html;}
// Register the Flickr shortcodeadd_shortcode('flickr-photoset', 'fi_shortcode');
![Page 54: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/54.jpg)
// Parse the photoset shortcodefunction fi_shortcode( $atts, $content ) { $photoset_id = fi_photoset_id( $content ); $html = fi_photoset( $photoset_id ); return $html;}
// Register the Flickr shortcodeadd_shortcode('flickr-photoset', 'fi_shortcode');
![Page 55: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/55.jpg)
// Parse the photoset shortcodefunction fi_shortcode( $atts, $content ) { $photoset_id = fi_photoset_id( $content ); $html = fi_photoset( $photoset_id ); return $html;}
// Register the Flickr shortcodeadd_shortcode('flickr-photoset', 'fi_shortcode');
![Page 56: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/56.jpg)
![Page 57: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/57.jpg)
![Page 58: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/58.jpg)
javascripts
photo by Don Solo
![Page 59: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/59.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_js(){$site_url = get_option( 'siteurl' );$lightbox_script = $site_url . FI_WEB_PATH . '/jquery.lightbox-0.5.pack.js';
wp_enqueue_script( 'jquery-lightbox', $lightbox_script, array('jquery'), '0.5' );}
add_action('wp_head', 'sd_js', 5);
![Page 60: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/60.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_js(){$site_url = get_option( 'siteurl' );$lightbox_script = $site_url . FI_WEB_PATH . '/jquery.lightbox-0.5.pack.js';
wp_enqueue_script( 'jquery-lightbox', $lightbox_script, array('jquery'), '0.5' );}
add_action('wp_head', 'sd_js', 5);
![Page 61: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/61.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_js(){$site_url = get_option( 'siteurl' );$lightbox_script = $site_url . FI_WEB_PATH . '/jquery.lightbox-0.5.pack.js';
wp_enqueue_script( 'jquery-lightbox', $lightbox_script, array('jquery'), '0.5' );}
add_action('wp_head', 'sd_js', 5);
![Page 62: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/62.jpg)
stylesheets
photo by kirainet
![Page 63: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/63.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_css(){$site_url = get_option( 'siteurl' );$css = $site_url . FI_WEB_PATH . '/screen.css';
wp_enqueue_style( 'fi_screen', $css );}
add_action('wp_head', 'fi_js', 5);
![Page 64: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/64.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_css(){$site_url = get_option( 'siteurl' );$css = $site_url . FI_WEB_PATH . '/screen.css';
wp_enqueue_style( 'fi_screen', $css );}
add_action('wp_head', 'fi_js', 5);
![Page 65: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/65.jpg)
define( 'FI_WEB_PATH', '/wp-content/plugins/flickr-insert' );
function fi_css(){$site_url = get_option( 'siteurl' );$css = $site_url . FI_WEB_PATH . '/screen.css';
wp_enqueue_style( 'fi_screen', $css );}
add_action('wp_head', 'fi_js', 5);
![Page 66: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/66.jpg)
photo by tantek
![Page 67: WordPress plugin development plugin development (with pictures) Simon Wheatley WordPress plugin development (with pictures) Simon Wheatley plugins photo by djking anatomy of a plugin](https://reader030.fdocuments.net/reader030/viewer/2022032613/5ad22c667f8b9a86158cd0b3/html5/thumbnails/67.jpg)
that was an WordPress
plugin development(with pictures)
Simon Wheatleywww.simonwheatley.co.uk