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
/** | |
* Helper function for registering and loading scripts and styles. | |
* Uses regex to determine if the file is CSS or JavaScript and calls | |
* the proper WordPress register and enqueue functions accordingly. | |
* | |
* @name ID to register with WordPress | |
* @file_path Path to actual file, relative to your plugin or theme, without preceding slash. | |
* @for Whether this is for a plugin or a theme. | |
*/ | |
function load_file($name, $file_path, $for = 'plugin') { |
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
#!/bin/bash | |
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert | |
# Disclaimer: It might not bloody work | |
# Disclaimer 2: I'm not responsible for any screwups ... :) | |
# DB Variables | |
echo "MySQL Host:" | |
read mysqlhost | |
export mysqlhost |
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 script outputs an array of file hashes recursively for the current directory. | |
* Useful for generating hashlist for security scanning programs | |
* | |
*/ | |
function recursive_md5($dir, $types = null, $recursive = true, $baseDir = '') | |
{ | |
$to_ignore = 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 | |
// Get the POST data, if you are sending SMS as a response to a form. | |
$form = $_POST['form']; | |
// Insert your message here. Pull some results from $form or do whatever. | |
$message = 'Message Here.'; | |
$subject = 'Whatever'; | |
$to = array( | |
'Sprint' => '[email protected]', |
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 | |
// URL Encode the address | |
$address = urlencode($data['storelocator']['address']); | |
// Get the JSON response from google. You can also get XML by changing geocode/json to geocode/xml | |
$geo = file_get_contents('http://maps.google.com/maps/api/geocode/json?sensor=false&address='.$address); | |
// Decode the results into an Object | |
$result = json_decode($geo); |
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
/* | |
* This is a base container for | |
* whenever I use jQuery Cycle. | |
* http://jquery.malsup.com/cycle/ | |
* | |
* Use this as base HTML | |
* | |
* <div id="slider"> | |
* <div id="slides"> | |
* <div class="slide" style="display:block">...</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
=== Using Git with WordPress Plugin Development === | |
git svn clone -s -r<rev-number> https://svn.wp-plugins.org/<plugin-path> <-- Clone the plugin repo | |
cd <plugin-path> <-- change to directory | |
git svn fetch <-- Pull svn history | |
git remote add -f github [email protected]:<github-url> <-- add github remote | |
/* ADD CODE */ <-- write code | |
git add * <-- add to git | |
git commit -m "Starting to code" <-- commit changes | |
git svn dcommit <-- push to svn | |
git push -f github <-- push to github |
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
/* | |
* This goes at the top of your plugin edit view, | |
* and will ask for confirmation before you leave. | |
* Be sure to replace viewname with your controller | |
* name, shortened. If you follow 2.5 guidelines | |
* with sub controllers that handel specific parts | |
* of the application, then this will work fine. | |
*/ | |
Joomla.submitbutton = function(task) { |
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
-- Old Post Meta sometimes creeps | |
-- in from manually deleting revisions | |
-- and other things direct from the | |
-- database. Using this SQL below | |
-- you can remove the postmeta remnants | |
-- that have been left behind. | |
DELETE a | |
FROM wp_postmeta AS a | |
LEFT JOIN wp_posts AS b |
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 | |
/** | |
* Paste this code in your theme's functions.php | |
* file and wherever you normally would call | |
* `get_option_tree('option-name');`, use | |
* `get_theme_option('option-name');` instead. | |
* This will pass through the already retrieved | |
* global $option_tree (called when your theme loads) | |
* and save you from several additional database | |
* calls on a single page request. |
OlderNewer