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 | |
/* | |
Plugin Name: Timeline Express Custom Icon Filter Test | |
*/ | |
add_filter( 'timeline-express-custom-icon-html', 'pn_timeline_express_custom_icon_html_test', 10, 3 ); | |
function pn_timeline_express_custom_icon_html_test( $html, $post, $timeline_express_options ) { | |
$custom_png_icon = get_post_meta( $post->ID, '_custom_png_icon', true ); |
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 | |
/* | |
Plugin Name: Revisions in List Table | |
Description: Allows a list of revisions to display in the dashboard list tables | |
Author: Pete Nelson | |
Version: 1.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit( 'restricted access'); |
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 | |
/** | |
* Plugin Name: GGA API Helper | |
* Description: Prevents certain plugins from being loaded during API requests to reduce overhead. | |
* Author: Pete Nelson (@GunGeekATX) | |
* Version: 1.0.0 | |
*/ | |
/* |
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 | |
/* | |
Plugin Name: GGA SSH2 Sample | |
Description: Sample SSH2 upload | |
Author: Pete Nelson (@GunGeekATX) | |
Version: 1.0 | |
*/ | |
if (!defined( 'ABSPATH' )) exit('restricted access'); |
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 ( function_exists( 'add_shortcode' ) && ! function_exists( 'add_shortcake' ) ) { | |
// tasty WordPress add_shortcode alias, for @technosailor | |
function add_shortcake( $tag, $func ) { | |
add_shortcode( $tag, $func ); | |
} | |
} |
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_filter( 'wp_handle_upload_prefilter', 'gga_filter_large_image_dimensions' ); | |
function gga_filter_large_image_dimensions( $file ) { | |
$maxsize = 2000; | |
if ( false !== strpos($file['type'], 'image/') ) { | |
$size = getimagesize( $file['tmp_name'] ); |
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 | |
/* | |
Plugin Name: GGA - git branches | |
Description: Dashboard Widget | |
Author: Pete Nelson | |
Version: 1.0 | |
*/ | |
if (!defined( 'ABSPATH' )) exit('restricted access'); |
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
function array_insert($array, $values, $offset) { | |
// http://stackoverflow.com/questions/1783089/array-splice-for-associative-arrays/11114956#11114956 | |
return array_slice($array, 0, $offset, true) + $values + array_slice($array, $offset, NULL, true); | |
} | |
function admin_columns($columns) { | |
// this is the 'manage_edit-{post-type}_columns' filter | |
// add_filter( 'manage_edit-' . self::$post_type . '_columns', array($this, 'admin_columns'), 10, 1 ) ; | |
$columns = array_insert($columns, array('sales-channel' => 'Sales Channel'), 2); | |
return $columns; |
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
function get_term_by_value($taxonomy, $field, $value) { | |
// probably a better way to do this, but this works for now | |
// get_field is part of Advanced Custom Fields | |
if (function_exists('get_field')) { | |
foreach (get_terms( $taxonomy ) as $term) { | |
$field = get_field($field, $term); | |
if ($value == $field) | |
return $field; | |
} |