This file contains hidden or 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 | |
/** | |
* You give me state, I give you abbreviation! | |
*/ | |
public function stateByAbbreviation( $abbr=null ){ | |
if ( is_null( $abbr ) ) | |
die('need abbr'); |
This file contains hidden or 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 | |
if ( ! empty( $_FILES ) ) { | |
$media = new MediaUpload; | |
$uploaded_media = $media->saveUpload( $field_name='Filedata' ); | |
/** | |
* @todo MediaUpload does NOT handle resizing of images, | |
* normally its done in WordPress, but for some reason |
This file contains hidden or 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 | |
/** | |
* Start auto loading | |
* | |
* Everything is based on the presence of a plugin/your-plugin/controller/{$post_type}_controller.php | |
* file if this file is present it is read and $post_type is paresed out and used for the model, js, | |
* and css file. If a css or js file isn't present one will be created for you given we can write to | |
* the dir. | |
*/ |
This file contains hidden or 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
// Snippet from events/index.html.php | |
<!-- Track --> | |
<div class="row"> | |
<h2 class="title"><?= $events->getTrackTitle( $post->ID ); ?></h2> | |
<div class="image-container"> | |
<img src="<?= $tracks->getMapImage( $events->getTrackId( $post->ID ), 'medium' ); ?>" /> | |
</div> | |
</div> | |
<!-- --> |
This file contains hidden or 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 file handles redirecting of our templates to our given views | |
* dir and anything else. | |
* | |
* Check if the themer has made a theme file in their | |
* theme dir, if not load our default. | |
* | |
* @uses template_redirect http://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect | |
*/ |
This file contains hidden or 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 ID of all Venues in a given Region (full region) | |
*/ | |
public function getVenueByRegion( $region=null ){ | |
$args = array( | |
'post_type' => 'tracks', | |
'posts_per_page' => -1, | |
'post_status' => 'published', | |
'meta_query' => array( |
This file contains hidden or 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 | |
public function randomBanner(){ | |
$obj_local_venues = new Tracks; | |
$local_venues = $obj_local_venues->getLocalVenues(); | |
$venue_ids = array(); | |
foreach( $local_venues as $venue ){ |
This file contains hidden or 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 if ( $event ) : ?> | |
<h1><a href="<?= $event['link']; ?>"><?= $event['title']; ?></a></h1> | |
<p class="date-time"><time class="post-time"><?= $event['date']; ?></time></p> | |
<div style="float: left;"> | |
<ul class="inline" style="margin: 10px 0 0;"> | |
<li style="margin-top: -12px; float: left;"><?php load_template( VIEWS_DIR . 'shared/facebook-button.html.php' ); ?></li> | |
<li><?php load_template( VIEWS_DIR . 'shared/twitter-like-button.html.php' ); ?></li> | |
</ul> | |
</div> | |
<?php else : ?> |
This file contains hidden or 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 | |
// more stuff done here | |
/** | |
* Start auto loading | |
* | |
* Everything is based on the presence of a plugin/your-plugin/controller/{$post_type}_controller.php | |
* file if this file is present it is read and $post_type is paresed out and used for the model, js, | |
* and css file. If a css or js file isn't present one will be created for you given we can write to |
This file contains hidden or 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('template_redirect', function() { | |
$tmp = explode( '/', $_SERVER['REQUEST_URI'] ); | |
$my_slug = 'feeds'; | |
if ( isset( $tmp ) && $tmp[1] == $my_slug ) { | |
load_template( '/path/to/my/template/' ); | |
// or do what ever you want | |
exit(); |