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 | |
function prettybox($class, $func_name) { | |
echo '<div class="' . $class . '">'; | |
call_user_func($func_name); | |
echo '</div>'; | |
} | |
function main_page() { |
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 | |
function bootstrapper() { | |
$theme = get_theme( get_current_theme() ); | |
if ( $theme['Template'] !== 'your-theme' ) | |
add_action( 'admin_notices', 'wrong_theme_notice' ); | |
else | |
plugin_init(); |
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
function get_image_id_like_genesis_does() { | |
if ( has_post_thumbnail() ) | |
$id = get_post_thumbnail_id(); | |
else | |
$id = genesis_get_image_id( 0 ); | |
return $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
<VirtualHost *:80> | |
DocumentRoot "/Users/ericlewis/Sites/badgestack" | |
ServerName badgestack.dev | |
</VirtualHost> | |
<VirtualHost *:80> | |
DocumentRoot "/Users/ericlewis/Sites/badgestack" | |
ServerName wcet.badgestack.dev | |
</VirtualHost> |
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
// Accepts a UTC timestamp and outputs the Badgestack desired formatting | |
// in the locally set timezone based on the WP settting | |
function get_timestamp_locally_modified($timestamp) { | |
$date = new DateTime($timestamp, new DateTimeZone('UTC')); | |
date_timezone_set( $date, new DateTimeZone( get_option('timezone_string') ) ); | |
$timestamp = $date->format( 'F j, Y \a\t h:ia' ); | |
return $timestamp; | |
} |
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
if ( $item_id | |
&& in_array( $item_id, $wds_class_game_items ) | |
&& in_array( $author_id, $group_members ) | |
&& ( ! $_GET['from_id'] | |
|| $student_for == $_GET['from_id'] | |
|| in_array( $_GET['from_id'], $students_nominated ) | |
) | |
&& ( $view == 'all' | |
|| $view == $this_status | |
) |
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 | |
add_action('init', 'register_gallery_endpoint'); | |
function register_gallery_endpoint() { | |
add_rewrite_endpoint( 'gallery', EP_PERMALINK ); | |
} | |
add_action('template_redirect', 'catch_gallery_endpoint'); |
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
if ( $debug ) | |
echo 1; | |
while ( $row = @mysql_fetch_object( $this->result ) ) { | |
$this->last_result[$num_rows] = $row; | |
$num_rows++; | |
} | |
if ( $debug ) | |
echo 2; |
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
foreach ( $stuff as $stuff_key => $bits ) { | |
foreach ( $bits as $bit_key => $bit ) { | |
$new[$bit_key][$stuff_key] = $bit; | |
} | |
} |
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
Copyright 2012 Eric Lewis | |
Version: @@ver@@ Timestamp: @@timestamp@@ | |
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU | |
General Public License version 2 (the "GPL License"). You may choose either license to govern your | |
use of this software only upon the condition that you accept all of the terms of either the Apache | |
License or the GPL License. | |
You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at: |
OlderNewer