Skip to content

Instantly share code, notes, and snippets.

@bacoords
bacoords / pull.sh
Created January 18, 2025 18:35
Pull production database and wp-content into your local environment with WP-CLI
#!/bin/bash
# Configuration variables - replace with your values
REMOTE_HOST="[email protected]"
REMOTE_PATH="files"
LOCAL_PATH="wp-content"
# Database name
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
DB_BACKUP="wp_backup_${TIMESTAMP}.sql"
@growdev
growdev / update_next_payment.php
Created February 16, 2021 17:05
Update next payment date for subscribers
<?php
/**
* Update next payment date for subscriptions.
* Run this script using WP CLI:
* $ wp eval-file update_next_payment.php
*/
$subs = [
// ids of subscriptions to update
];
@matthewjberger
matthewjberger / instructions.md
Last active April 20, 2025 02:17
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@fazlurr
fazlurr / WP_Query_Args.php
Last active March 24, 2025 16:17 — forked from billerickson/gist:3698476
WP_Query arguments list
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@justintadlock
justintadlock / register-post-type.php
Last active January 8, 2025 22:04
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public