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 | |
//* the the default upload path to work in normal WP structure | |
add_filter("gform_upload_path", "change_upload_path", 20, 2); | |
function change_upload_path($path_info, $form_id){ | |
$wp_upload_path = wp_upload_dir(); | |
$path_info["path"] = $wp_upload_path['path'] . '/'; | |
$path_info["url"] = $wp_upload_path['url'] . '/'; | |
return $path_info; |
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 | |
namespace Classes; | |
/*////////////////////////////////////////////////////////////////////////////// | |
================================================================================ | |
Ajax_Controller | |
- registers, enqueues, localizes ajax js file | |
- passes method and params to Ajax_Function_Suite(); | |
- returns $ajax_function_suite->respond() as JSON | |
- don't forget nonce |
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 | |
/** | |
* @param = multi-dimensionnal array with dups | |
* @return = unique multi-dimensional array | |
*/ | |
function make_arrays_unique( $array ) | |
{ | |
array_map("unserialize", array_unique(array_map("serialize", $arras))); | |
} |
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 htmlEncode(str) { | |
return str.replace(/&/g, '&') | |
.replace(/"/g, '"') | |
.replace(/'/g, ''') | |
.replace(/</g, '<') | |
.replace(/>/g, '>'); | |
} |
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 | |
$highlights = new WP_Query($args); | |
$sort = function(&$posts) { | |
$props = array('year', 'authors'); | |
usort($posts, function($a, $b) use ($props) { | |
if ($a->$props[0] == $b->$props[0]) |
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('genesis_before', function() { | |
global $wpdb; | |
$post_type = 'product'; | |
$query = " | |
SELECT DISTINCT($wpdb->postmeta.meta_key) | |
FROM $wpdb->posts | |
LEFT JOIN $wpdb->postmeta |
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
Show hidden characters
{ | |
"presets": ["es2015"] | |
} |
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
""" | |
Some python from a free python class offered by The Tech Academy Portland | |
https://www.meetup.com/techacademy/ | |
""" | |
import math | |
from random import randint | |
randMin = 0 | |
randMax = 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
<?php | |
/* | |
Plugin Name: Sample Plugin | |
Plugin URI: | |
Description: Sample code for the Portland WordPress MeetUp Hooks and Filters Talk | |
Version: 1.0.0 | |
Author: adamplabarge | |
Author URI: https://github.com/adamplabarge | |
Text Domain: sample-plugin | |
License: GPLv2 |
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: TheAudioBeatnik Category Slideshow | |
* Description: A category page slideshow using Slick.js and WP Plugin Advanced Custom Fields | |
* Author: Adam LaBarge | |
* Version: 1.0 | |
* Author URI: https://www.linkedin.com/in/adamlabarge | |
*/ | |
class tab_CategorySlideShow { |
OlderNewer