Skip to content

Instantly share code, notes, and snippets.

View landbryo's full-sized avatar
🤠
Always Excitied

Landon Otis landbryo

🤠
Always Excitied
View GitHub Profile
@joshlevinson
joshlevinson / .bash_profile
Last active April 21, 2023 12:04
WP CLI + Xdebug
# Add this to /config/bash_profile
function wpd {
export XDEBUG_CONFIG="idekey=VVVDEBUG remote_connect_back=1"
wp "$@"
unset XDEBUG_CONFIG
};
# Run these commands:
# vagrant ssh
# sudo cp /srv/config/bash_profile /home/vagrant/.bash_profile
# source ~/.bash_profile
@spivurno
spivurno / gform_userregistration_feed_settings_fields.php
Created October 28, 2015 11:46
Gravity Forms // Hooks // gform_userregistration_feed_settings_fields
<?php
add_filter( 'gform_userregistration_feed_settings_fields', 'add_custom_user_registration_setting', 10, 2 );
function add_custom_user_registration_setting( $fields, $form ) {
// adding my custom setting to the Additional Settings section
$fields['additional_settings']['fields'][] = array(
'name' => 'myCustomSetting',
'label' => __( 'My Custom Setting', 'my-text-domain' ),
'type' => 'checkbox',
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active May 27, 2024 17:37
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
@robneu
robneu / facet-wp-infinite-scroll.js
Last active October 9, 2021 22:26
Infinite scroll for FacetWP
/* globals FWP */
/**
* JavaScript for FacetWP Infinite Scroll
*/
(function( $ ) {
'use-strict';
var throttleTimer = null;
var throttleDelay = 100;
@emeaguiar
emeaguiar / default.conf
Last active February 9, 2023 16:02
nginx conf
# Basic conf
server {
server_name _;
return 302 $scheme://mysite.test$request_uri;
}
# Custom conf
server {
server_name ~^(.*)\.mysite\.test$ mysite.test;
root /app/public/;
@andrewlimaza
andrewlimaza / add-my-discount-code.php
Created February 11, 2019 13:52
Add Discount Code Menu Item to Paid Memberships Pro 2.0
<?php
/**
* Add discount code menu item under "Memberships" admin menu.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_menu_add_discounts() {
add_submenu_page( 'pmpro-dashboard', __( 'Discount Codes', 'paid-memberships-pro' ), __( 'Discount Codes', 'paid-memberships-pro' ), 'pmpro_discountcodes', 'pmpro-discountcodes', 'pmpro_discountcodes' );
}
add_action( 'admin_menu', 'my_pmpro_menu_add_discounts' );