Skip to content

Instantly share code, notes, and snippets.

View bhubbard's full-sized avatar
:octocat:
Hello

Brandon Hubbard bhubbard

:octocat:
Hello
View GitHub Profile
@bhubbard
bhubbard / gist:2b1100d0e20291b14115199a98c5191a
Created December 28, 2022 17:30
6 +25 You can Disable External request by adding this in your wp-config.php ( Also, you can specify domain which you don't want to block like this).
define( 'WP_HTTP_BLOCK_EXTERNAL', TRUE );
define( 'WP_ACCESSIBLE_HOSTS', 'example.com, domain.com' );
<?php
if ( ! function_exists( 'wpcfu_output_file_upload_form' ) ) {
/**
* Output the form.
*
* @param array $atts User defined attributes in shortcode tag
*/
function wpcfu_output_file_upload_form( $atts ) {
# This is a workflow to compile and deploy to WPEngine Production
name: PROD Deploy to WPEngine
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the release-1 branch
push:
branches: [ main ]
npm install -g https://github.com/observing/thor
// https://github.com/covenanttechnologysolutions/connectwise-rest/issues/37#issuecomment-963586048
function getAllCompanyContacts = (id) => {
return paginate(
// reference to function to use
cwRest.CompanyAPI.Contacts.getContacts,
// function args
[{conditions: `company/id = ${id}`}],
// include a reference to function's module
cwRest.CompanyAPI.Contacts);
@bhubbard
bhubbard / resume.json
Last active November 18, 2021 13:36
JSON Resume
{
"basics": {
"name": "Brandon Hubbard",
"label": "WordPress Developer",
"picture": "http://www.gravatar.com/avatar/3596404cbc9ffb7d4f48524e08340d86.png",
"email": "bkhubbard@gmail.com",
"phone": "(818) 297-4175",
"website": "https://brandonhubbard.com",
"summary": "Web Developer Manager at Snap One",
"location": {
@bhubbard
bhubbard / wp-update
Created September 21, 2021 00:03 — forked from keesiemeijer/wp-update
A bash script to update everything WordPress (core, plugins, themes and comments).
#!/usr/bin/env bash
# =============================================================================
#
# *** WARNING: THIS SCRIPT IS NO LONGER MAINTAINED ***
#
# use https://github.com/keesiemeijer/wp-update instead
#
# =============================================================================
@bhubbard
bhubbard / ajax_class.php
Created September 18, 2021 02:45 — forked from sfgarza/ajax_class.php
Boilerplate code for making AJAX calls to wordpress.
<?php
if (!defined('ABSPATH')) {
exit;
}
class ajax_class
{
public function __construct()
{
//Hook = 'wp_ajax_{$action}' where $action must equal the AJAX request's 'action' property.
@bhubbard
bhubbard / wp-config.php
Created June 23, 2021 16:44 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@bhubbard
bhubbard / setup-phpunit.sh
Created June 19, 2021 03:04 — forked from DevinWalker/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/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
#
# WordPress and the WP_UnitTestCase are installed in the /tmp directory
# The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file