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 featured image sizes | |
add_image_size( 'custom-small', 500, 300, true ); // name, width, height, crop | |
add_image_size( 'custom-large', 1840, 793, true ); | |
// Register the image sizes for the Add Media modal | |
add_filter( 'image_size_names_choose', function( $sizes ) { | |
return array_merge( $sizes, array( | |
'custom-small' => __( 'Custom Small' ), |
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/php | |
<?php | |
// What is the URI of the Gist? Make sure you've provided a path to the "raw" Gist. | |
$GistURI = 'http://...'; | |
// Select "Shell Script" from TextExpander content type! | |
print file_get_contents($GistURI); |
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: [Your Great Plugin Name Goes Here] | |
Description: [Along with a Great Description] | |
Version: 0.1 | |
Author: Cory Piña | |
Author URI: http://thisiscory.com | |
*/ | |
// HOW TO USE THIS |
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
// ==UserScript== | |
// @name Flywheel Backups to Local Date | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Convert UTC dates to local Time | |
// @author Cory Piña | |
// @match https://app.getflywheel.com/*/backups | |
// @grant none | |
// ==/UserScript== |
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 | |
// Sets Beaver Builder as the default editor. | |
function make_beaver_builder_default( $post_ID, $post, $update ) { | |
if ( ! $update ) { | |
update_post_meta( $post_ID, '_fl_builder_enabled', true ); | |
} | |
} | |
add_action( 'wp_insert_post', 'make_beaver_builder_default', 10, 3 ); |
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 | |
// Grab and display a user's Instagram feed without need for API access | |
// Replace USERNAME with username as string. | |
// IMPORTANT: This relies on the queryfeed.net service, which may or may not always be available | |
function instagramFeed() { | |
// Grab and load the feed as a variable | |
$user = "USERNAME"; | |
$feed = "https://queryfeed.net/instagram?q=" . $user; |
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 will display native-style admin notice in the WordPress admin area | |
function displayCustomNotice() { ?> | |
<div class="notice notice-information"> | |
<p>Your text here!</p> | |
</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
window.addEventListener("hashchange", function () { | |
window.scrollTo(window.scrollX, window.scrollY - 100); | |
}); |
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 | |
// Include all PHP files in FOLDERNAME | |
$dir = plugin_dir_path(__FILE__); | |
foreach(glob($dir . "FOLDERNAME/[!_]*.php") as $file){ | |
require $file; | |
} |
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 CSS to Events Admin pages | |
*/ | |
add_action('admin_head', 'my_custom_fonts'); | |
function my_custom_fonts() { | |
// Get current screen if targeting post type is necessary |