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: Updates Transient Flusher | |
Description: Deletes the update_themes and update_plugins transients. Forces WordPress to check for plugin and theme updates on every page load. FOR TESTING ONLY. | |
*/ | |
function jp_delete_update_transients() { | |
delete_transient( 'update_themes' ); | |
delete_transient( 'update_plugins' ); |
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
#!/bin/bash | |
# Created by Sindre Sorhus | |
# Magically retrieves a GitHub users email even though it's not publicly shown | |
[ "$1" = "" ] && echo "usage: $0 <GitHub username> [<repo>]" && exit 1 | |
[ "$2" = "" ] && repo=`curl "https://api.github.com/users/$1/repos?type=owner&sort=updated" -s | sed -En 's|"name": "(.+)",|\1|p' | tr -d ' ' | head -n 1` || repo=$2 | |
curl "https://api.github.com/repos/$1/$repo/commits" -s | sed -En 's|"(email\|name)": "(.+)",?|\2|p' | tr -s ' ' | paste - - | sort -u -k 1,1 |
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
/** | |
* Removes the billing details section on the checkout screen. | |
*/ | |
function jp_disable_billing_details() { | |
remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields' ); | |
} | |
add_action( 'init', 'jp_disable_billing_details' ); |
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 | |
// This loads the react-devtools script in wp-admin when using Safari. | |
add_action( 'admin_enqueue_scripts', function() { | |
if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari' ) !== false ) { | |
?> | |
<script src="http://localhost:8097"></script> | |
<?php | |
} | |
} ); |
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 | |
/** | |
* Display the post time in a human readable format | |
* | |
* @return string | |
*/ | |
function carmack_human_time_diff() { | |
$post_time = get_the_time( 'U' ); | |
$time_now = date( 'U' ); |
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: Commercial Client | |
* Plugin URI: http://pento.net/ | |
* Description: A sample client plugin for showing updates for non-WordPress.org plugins | |
* Author: pento | |
* Version: 0.1 | |
* Author URI: http://pento.net/ | |
* License: GPL2+ | |
*/ |
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
#!/usr/bin/env bash | |
# =============================================================================== | |
# Script to install PHPUnit in the Local by Flywheel Mac app | |
# These packages are installed | |
# | |
# PHPUnit, git, subversion, composer, curl and wget | |
# | |
# The $WP_CORE_DIR and $WP_TESTS_DIR environment variables are added to the ~/.bashrc file | |
# |
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 simple_plugin_updater( $update_plugins, $transient_name ) { | |
$plugin = json_decode( | |
json_encode( | |
array( | |
'new_version' => 89, | |
'stable_version' => 89, | |
'name' => 'My Fake Plugin', | |
'slug' => 'my-fake-plugin.php', | |
'url' => 'https://myfakeplugin.com', |
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
/** | |
* This plugin adds support for custom restriction messages per post. | |
* If a custom message exists, it is used in place of the ones defined | |
* in the RCP settings under Restrict > Settings > General. | |
*/ | |
/** | |
* Displays the custom message metabox on the post edit screen. | |
*/ | |
function jp_rcp_post_level_restriction_message_metabox() { |
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 | |
// Sets the post format to audio on product submissions made in Frontend Submissions. | |
function jp_set_audio_post_format( $post_id ) { | |
set_post_format( $post_id, 'audio' ); | |
} | |
add_action( 'fes_submit_submission_form_bottom', 'jp_set_audio_post_format' ); |
NewerOlder