This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Description: A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes. | |
Author: Stephen Harris | |
Author URI: http://www.stephenharris.info | |
*/ | |
/* Copyright 2011 Stephen Harris (contact@stephenharris.info) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* A walker class to use that extends wp_dropdown_categories and allows it to use the term's slug as a value rather than ID. | |
* | |
* See http://core.trac.wordpress.org/ticket/13258 | |
* | |
* Usage, as normal: | |
* wp_dropdown_categories($args); | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
! defined( 'ABSPATH' ) AND exit; | |
/* | |
Plugin Name: WP Cron Jobs List | |
Plugin URI: https://github.com/franz-josef-kaiser | |
Description: List WordPress internal cron jobs (array data) after the footer. Based on Kaiser's original plug-in https://gist.github.com/987128 | |
Author: Franz Josef Kaiser, Stephen Harris | |
Author URI: https://github.com/franz-josef-kaiser | |
Version: 0.3 | |
License: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Returns the blog's timezone as a DateTimeZone object | |
* | |
*/ | |
function sh_get_blog_timezone(){ | |
$timezone = wp_cache_get( 'sh_blog_timezone' ); | |
if ( false === $timezone || ! ($timezone instanceof DateTimeZone) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Requires Event Organiser 1.6+ | |
* | |
* Adds the venue's name to the content appearing in the tooltip when hovering over an event in fullcalendar | |
* @uses eventorganiser_event_tooltip filter. | |
* | |
* The filter passes 4 objects: the content of the toolip, the post ID of the event, the occurrence ID | |
* of the event and the post object (the last one probably won't often bed needed). | |
* In this example we just need the first two. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* An implementation of the AES cipher (CBC mode). | |
* For reference http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf | |
* | |
* @author Stephen Harris (contact@stephenharris.info) | |
* @license GPL | |
* | |
* Example usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is a basic example of implementing front end creation of events with Event Organiser | |
* @see http://www.stephenharris.info/2012/front-end-event-posting/ | |
* @see http://wordpress.org/extend/plugins/event-organiser/ | |
* | |
*/ | |
add_shortcode('my_event_form','my_event_form_shortcode_handler'); | |
function my_event_form_shortcode_handler( ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds upcoming events to the venue tooltip in Event Organiser. | |
* | |
* Uses the eventorganiser_venue_tooltip filter to append content to the venue tooltip. This tooltip appears when | |
* clicking a venue on a map (if tooltips are enabled). | |
* @uses eventorganiser_venue_tooltip. | |
* | |
* The filter passes 2 objects: the content of the toolip, the venue (term) ID | |
* | |
* @requires Event Organiser 1.6+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Display a list of upcoming events with Event Organiser | |
* | |
* Snippet that produces a simple list of the next 5 upcoming events. | |
*/ | |
//Get upcoming ' | |
$events = eo_get_events(array( | |
'numberposts'=>5, | |
'event_start_after'=>'today', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A function which adds classes to event pages corresponding to the event | |
* E.g. adds 'eo-event-cat-[cat slug]' class for each category the event belongs to. | |
* Adds 'eo-event-venue-[venue slug]' if the event has a venue | |
* Adds time based class: eo-event-future/past/running for future/past/running events | |
* | |
* @url http://wordpress.org/support/topic/problem-with-highlight-in-menu-change-url-of-events?replies=8#post-3458829 | |
* Not tested | |
*/ | |
add_filter( 'body_class', 'my_event_organiser_add_classes_to_event_body'); |
NewerOlder