This file contains hidden or 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 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' ); |
This file contains hidden or 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
# Basic conf | |
server { | |
server_name _; | |
return 302 $scheme://mysite.test$request_uri; | |
} | |
# Custom conf | |
server { | |
server_name ~^(.*)\.mysite\.test$ mysite.test; | |
root /app/public/; |
This file contains hidden or 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
/* globals FWP */ | |
/** | |
* JavaScript for FacetWP Infinite Scroll | |
*/ | |
(function( $ ) { | |
'use-strict'; | |
var throttleTimer = null; | |
var throttleDelay = 100; |
This file contains hidden or 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 | |
// 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 |
This file contains hidden or 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( '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', |
This file contains hidden or 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
# 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 |