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 | |
/* | |
Adding First and Last Name to Checkout Form | |
*/ | |
//add the fields to the form | |
function my_pmpro_checkout_after_password() | |
{ | |
if(!empty($_REQUEST['firstname'])) | |
$firstname = $_REQUEST['firstname']; |
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
/* | |
Important note! This code is included in PMPro versions 1.5.7 and later. | |
Adding this code will add 2x the number of days to the end of the subscription. | |
*/ | |
//if checking out for the same level, add remaining days to the enddate | |
function my_pmpro_checkout_level($level) | |
{ | |
global $pmpro_msg, $pmpro_msgt; | |
//does this level expire? are they an existing user of this level? |
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
/* | |
Switch `` with <pre lang="PHP"></pre> | |
*/ | |
function pmpro_code_wrap($content) | |
{ | |
$content = preg_replace("/`(.*?)`/s", '<pre lang="PHP">$1</pre>', $content); | |
return $content; | |
} | |
add_filter("the_content", "pmpro_code_wrap", -1); |
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: PMPro Customizations (Register Helper Example) | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for Paid Memberships Pro (Register Helper Example) | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
//we have to put everything in a function called on init, so we are sure Register Helper is loaded |
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 | |
# 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 |
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
// shortcode: [demo-form] | |
function demo_form_shortcode( $atts ) { | |
$name = ''; | |
$email = ''; | |
$company = ''; | |
$errors = array(); | |
if ( isset( $_POST['demo_form_submitted'] ) |
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 | |
/* | |
WordPress Theme Template Hierarchy Last updated for WordPress 5.4 | |
================================== | |
This diagram is partially simplified for legibility. To view the complete template hierarchy in use on your site see the | |
Template panel in the Query Monitor plugin. | |
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
/** | |
* @typedef MutationCallback | |
* @param {NodeList} addedNodes A NodeList of elements that have been added to the DOM. | |
* @param {NodeList} removedNodes A NodeList of elements that have been removed from the DOM. | |
*/ | |
/** | |
* Add a MutationObserver to a DOM node. | |
* | |
* @example | |
* |
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
<input type="checkbox" value="1" name="popup_display_position_fixed" id="popup_display_position_fixed" <?php checked( $position_fixed, 1 ); ?>/> |
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
; This is part of my AutoHotkey [1] script that turns off my monitor when I | |
; press Win+\. | |
; It also turns the screensaver on at the same time, so that Windows Live | |
; Messenger (and any other programs) know I am away. | |
; I don't have a password on my screensaver, so there is a second version | |
; (Win+Shift+\) that locks the PC as well. | |
; Note: Sometimes the monitor comes back on after a second and I have to |
OlderNewer