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
#!/usr/bin/env bash | |
echo "Running boostrap.sh..." | |
echo "+---------------------------------------------------+" | |
echo "| Update apt-get |" | |
echo "+---------------------------------------------------+" | |
apt-get update | |
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
$('#jdugc_upload_form').on('submit', function(event) { | |
event.preventDefault(); | |
$('.loading-icon').show(); | |
$(this).ajaxSubmit({ | |
target: 'myResultsDiv', | |
type: 'post', | |
dataType: 'json', | |
start: function(){ | |
$('.loading-icon').show(); |
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
post-receive#!/bin/sh | |
### | |
# This file will deploy code from the repository into the | |
# specified web-root. | |
# | |
# File name: post-receive | |
# | |
# Instructions: | |
# 1. Uncomment and edit the lines below as needed |
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 | |
foreach( $items as $item ){ | |
if ( ! $item['name'] ) | |
continue; | |
print $item['name']; | |
// more code | |
// and stuff going on here |
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 | |
$venues = new Venues; | |
$venue_ids = $venues->IDs(); | |
$count = count( $venue_ids ); | |
$i = 1; | |
print '<pre>'; | |
foreach( $venue_ids as $id ){ | |
$email = $venues->contactEmail( $id ); | |
if ( ! $email ){ |
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 a object of ALL venues ids | |
*/ | |
public function IDs(){ | |
global $wpdb; | |
$query = "select ID from {$wpdb->prefix}posts where post_type = 'venues' and post_status = 'publish'"; | |
$tmp = 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 | |
$event = new Events(); | |
$event->post_type = array( | |
array( | |
'name' => 'Race Event', | |
'type' => 'events', | |
'has_one' => 'tracks', // add support 'has_many' => 'other_cpt' | |
'rewrite' => array( | |
'slug' => 'events' |
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 | |
/** | |
* Rename meta keys | |
* Usage: update_meta_key( 'old_key', 'new_key'); | |
*/ | |
function update_meta_key( $old_key=null, $new_key=null ){ | |
global $wpdb; | |
$query = "UPDATE ".$wpdb->prefix."postmeta SET meta_key = '".$new_key."' WHERE meta_key = '".$old_key."'"; |
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 | |
/** | |
* Usage: post_type_converter( 'tracks', 'venues'); | |
*/ | |
function post_type_converter( $from=null, $to=null, $post_id=null ){ | |
global $wpdb; | |
$query = "SELECT ID, post_type FROM $wpdb->posts WHERE post_type = '{$from}'"; |
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', 'boo' ); | |
function boo(){ | |
// ge the global post type | |
global $post_type; | |
// this is the one we want to match against |