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 | |
/* | |
A simple script to quickly anonymise the users of a WordPress website. | |
It works by replacing all of your existing users with new randomly generated user details. | |
Simply add this file to the root directory of your WordPress installation, then go to <<your website address/>>/anonymise-users.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 | |
/* | |
Plugin Name: Convert SMURF to CMB2 repeatable field groups | |
Plugin URI: http://www.iweb.co.uk/ | |
Description: Go through and zero index each SMURF array. | |
Version: 1.0.0 | |
Author: iWeb | |
Author URI: http://www.iweb.co.uk/ | |
*/ |
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 | |
function hwid_acf_admin_footer() { | |
?> | |
<script> | |
( function( $) { | |
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id ) { | |
// grab the classes defined within the field admin and put them in an array | |
var classes = $( '#' + id ).closest( '.acf-field-wysiwyg' ).attr( 'class' ); |
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: Convert pw_gallery to file_list | |
Plugin URI: https://github.com/mustardBees/cmb-field-gallery | |
Description: Rough, inefficient snippet for converting existing data from pw_gallery to file_list format. Hit example.com/?convert_pw_gallery_to_file_list. Use at your own risk. Backup first! | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
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
$ wp post list --format=ids | xargs wp post update --comment_status=closed | |
# Output: | |
# Success: Updated post 2514. | |
# Success: Updated post 2511. | |
# Success: Updated post 2504. | |
# Success: Updated post 2499. | |
# Success: Updated post 2441. | |
# etc... |
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 | |
# Usage: ./distribute_user.sh [username] [role] | |
ARGS="$@" | |
echo "Adding user $1 as $2 to all sites" | |
SITES=$(wp site list --field=url --format=csv) | |
for site in $SITES | |
do |
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 | |
/* | |
* Virtual Themed Page class | |
* | |
* This class implements virtual pages for a plugin. | |
* | |
* It is designed to be included then called for each part of the plugin | |
* that wants virtual pages. | |
* | |
* It supports multiple virtual pages and content generation functions. |
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 this as a mu-plugin. | |
if ( isset( $_GET['wp_maybe_auto_update'] ) ) { | |
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' ); | |
add_action( 'template_redirect', function() { | |
$time = date( 'r' ); | |
echo "Starting... $time<br />"; | |
delete_site_option( 'auto_core_update_failed' ); |
NewerOlder