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_filter('wcs_new_order_created','gens_renewal_order_created', 10, 2 ); | |
function gens_renewal_order_created($order, $subscription){ | |
$_user_id = $order->get_user_id(); | |
$user_info = get_userdata($_user_id); | |
$user_email = $user_info->user_email; | |
$args = array( | |
'posts_per_page' => -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
/** | |
* Adds icons for any custom order statuses | |
* Tutorial: http://www.skyverge.com/blog/changing-woocommerce-custom-order-status-icons/ | |
**/ | |
add_action( 'wp_print_scripts', 'skyverge_add_custom_order_status_icon' ); | |
function skyverge_add_custom_order_status_icon() { | |
if( ! is_admin() ) { | |
return; | |
} |
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: Image Meta Tests (Do not use in production!) | |
* Description: A small plugin to enable displaying and testing of image attachment meta data. The data is displayed on the Media Library list view screen. | |
* Version: 0.0.1-private-plugin | |
* Author: Andrew Ozz | |
* License: GPLv2 or later | |
* License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
* | |
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
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 | |
for uid in $(wp user list --field=ID) | |
do | |
pass=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32}` | |
wp user update $uid --user_pass="$pass" | |
done |
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
/** | |
* Remove plugins from search results in ClassicPress dashboard. | |
* A little ditty by Code Potent. https://codepotent.com | |
*/ | |
// Add slugs for any individual plugins to remove. | |
function codepotent_plugins_to_remove() { | |
$slugs = [ | |
'wordfence', | |
'jetpack', |
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
/** | |
* The following code will remove access to the /users/ endpoint. This makes the | |
* endpoint inaccessible while not blocking access to other endpoints. This code | |
* works with both WordPress and ClassicPress. | |
* | |
* Why do this? The REST API is very handy, however, by default, it exposes data | |
* that you may not want exposed – namely, your site's usernames. With a list of | |
* your usernames, the success of a brut-force attack becomes more likely. | |
* | |
*/ |
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
<html> | |
<!-- ... --> | |
<!-- Embed analytics.js as local file --> | |
<script src="/analytics.js"></script> | |
</html> |
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: Programmatically add Gravity Forms | |
Plugin URI: https://daan.kortenba.ch/programmatically-add-gravity-forms/ | |
Description: Programmatically add persistent Gravity Forms forms. | |
Author: Daan Kortenbach | |
Version: 0.1 | |
Author URI: https://daan.kortenba.ch/ | |
License: GPLv2 or later | |
*/ |
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 | |
//Options | |
$token = 'YOUR_TOKEN_HERE'; | |
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE'; | |
$channel = '#general'; | |
$bot_name = 'Webhook'; | |
$icon = ':alien:'; | |
$message = 'Your message'; |
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
/* Code goes in theme functions.php */ | |
add_filter( 'woocommerce_prevent_admin_access', '__return_false' ); | |
add_filter( 'woocommerce_disable_admin_bar', '__return_false' ); |
OlderNewer