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 | |
/** | |
* Plugin Name: SH Which Template Is This | |
* Description: Prints in the footer the template being used for that page. | |
* Author: Stephen Harris contact@stephenharris.info | |
* Author URI: http://stephenharris.info | |
* License: GPL | |
* License URI: http://www.gnu.org/copyleft/gpl.html | |
*/ | |
class SH_Which_Template_Is_This{ |
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 # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Toolbar hooks | |
* Description: Adds a toolbar item with the current page hooks. | |
* Version: 2012.06.19 | |
* Author: Thomas Scholz <info@toscho.de> | |
* Author URI: http://toscho.de | |
* License: MIT | |
* License URI: http://www.opensource.org/licenses/mit-license.php | |
*/ |
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 | |
/* | |
* Provides a function to add a 'publish' link to posts. | |
* Use sh_frontend_publish() to display the link | |
* | |
*/ | |
function sh_frontend_publish(){ | |
$post_id = get_the_ID(); | |
if( 'draft' == get_post_status($post_id) && current_user_can('edit_post',$post_id) && current_user_can('publish_posts') ){ |
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 | |
/* | |
* Gets IDs of the previous and next siblings (pages with the same parent as current post). | |
* Then uses wpse5422_display_prev_next to display links to them | |
* Must be used inside the loop. | |
* | |
* This is my solution to: http://wordpress.stackexchange.com/a/54463/9364 | |
*/ | |
function wpse5422_the_page_siblings(){ | |
$post_id = get_the_ID(); |
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
<?php | |
/* | |
* Get all users registered after $start and before $end (dates in yyyy-mm-dd format) | |
* | |
* Based on my answer to this question: http://wordpress.stackexchange.com/questions/51485/how-can-i-query-all-users-who-registered-today/51492#51492 | |
* | |
* @param (string) $start - start date in yyyy-mm-dd format | |
* @param (string) $end - end date in yyyy-mm-dd format | |
*/ |