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
# BACKUP FIRST | |
# You generally do not want to setup PMPro levels | |
# with both a recurring billing amount AND | |
# an expiration date. | |
# This SQL query will clear the expiration date | |
# for active recurring memberships. | |
# BACKUP FIRST | |
UPDATE wp_pmpro_memberships_users | |
SET enddate = '0000-00-00 00:00:00' | |
WHERE status = 'active' |
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 | |
/** | |
* This example is to show you the 'niche' options each Paid Memberships Pro - Register Helper Add-on field can take and how to use it. | |
* | |
* Add this to a Customizations Plugin and customize to suit your needs | |
*/ | |
function initialize_pmprorh_fields() { | |
// don't break if Register Helper is not loaded | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { |
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
/* | |
Perform an action on PMPro recurring orders only. | |
A recurring order here is one that | |
(1) Has an earlier order with the same subscription_transaction_id. | |
(2) Is not created at PMPro checkout. | |
Note that we are checking if function_exists for pmpro_isOrderRecurring incase | |
we add this to PMPro core. Also note that the $test_checkout param there is used | |
here to avoid #2 above. So this parameter will check if the currently running PHP | |
script is being fired at checkout, not necessarily if the order was created at checkout, |
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
;(function($){ | |
/* | |
Script Name: WP Auto Installer | |
Author: Mohan Dere | |
Version: 1.0 | |
Description : This script install new wordpress setup, create database with tables with content & run search replace database for new urls. | |
Last Update: 13 Mar 15 | |
*/ |
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 // Do not include this line in your Customizations plugin | |
/** | |
* Require specific category user meta to view posts in designated categories. | |
* Custom price-adjusting fields are added via PMPro Register Helper add on (required). | |
* Add all of this code to your active theme's functions.php or a custom plugin. | |
*/ | |
add_filter( 'pmpro_has_membership_access_filter', 'my_pmpro_additional_categories', 10, 4 ); | |
function my_pmpro_additional_categories( $hasaccess, $thepost, $theuser, $post_membership_levels ) { | |
global $wpdb; |
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 // do not include this line | |
/** | |
* Allow non-members to view restricted posts if they are less than 30 days old. | |
* | |
* Add this code to a custom plugin. | |
* | |
* Change the '-30 Days' below if you'd like to allow access for longer or shorter. | |
*/ | |
/** | |
* [open_new_posts_to_non_members description] |
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
If you've got local source code you want to add to a new remote new git repository without 'cloning' the remote first, do the following (I often do this - you create your remote empty repository in bitbucket/github, then push up your source) | |
1. Create the remote repository, and get the URL such as git://github.com/youruser/somename.git | |
2. If your local GIT repo is already set up, skips steps 2 and 3 | |
3. Locally, at the root directory of your source, git init | |
4. Locally, add and commit what you want in your initial repo (for everything, | |
git add . |
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
//Open external links into new tab | |
<script type="text/javascript"> | |
jQuery('a').filter(function () { | |
return this.hostname != window.location.hostname; | |
}).attr('target', '_blank'); | |
</script> | |
//Adding Fly-in Animations To Any Divi Section, Row and Module | |
//thanks to Gino Quiroz : https://quiroz.co/adding-fly-in-animations-to-any-divi-module/ | |
//Below are the CSS Class groups for each animation. |
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
/** | |
* How to link into the WordPress Customizer | |
*/ | |
Simple Link: | |
<a href="<?php echo esc_url( admin_url( 'customize.php' ) ); ?>">Link to Customizer</a> | |
Link to Panel: | |
$query['autofocus[panel]'] = 'nav_menus'; |
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 | |
//phpDoc for new PMPro function | |
/** | |
* A description of what the function does. | |
* | |
* @param {array, string, int, objext} {$variable_name} {Short description} | |
* @return {array, string, int, mixed, object} {$variable_name} {Short description} | |
* | |
* {@internal Any To-Dos etc.} | |
* |