git rm -r --cached .
git add .
git commit -am 'git cache refreshed'
git push
<?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; |
<?php | |
/** | |
* Adds dropdown for bbPress user role with Moderator and Participant as options | |
*/ | |
add_action( 'pmpro_add_member_fields', 'add_bbpress_role_to_add_member' ); | |
add_action( 'pmpro_add_member_added', 'pmpro_add_forum_role', 11 ); | |
function add_bbpress_role_to_add_member( $profileuser ) { | |
global $wp_roles; |
To set up php linting, you’ll want to install this PHP CodeSniffer repo and configure with this WordPress Coding Standards repo: . There are a number of ways to do this, whether direct download, Composer, Homebrew, Pear, etc. The following is what works for me on MacOS using Homebrew:
In a terminal window on your Mac, start by updating your Homebrew.
brew doctor
Then install the Code Sniffer:
<?php | |
/** | |
* When users cancel (are changed to membership level 0) we give them another "cancelled" level. | |
* Can be used to downgrade someone to a free level when they cancel. | |
* Will allow members to the "cancel level" to cancel from that though. | |
*/ | |
function pmpro_after_expiration_change_membership_levels( $level_id, $user_id ) { | |
// set this to the id of the level you want to give members when they cancel | |
$last_level_5 = 5; | |
$last_level_6 = 6; |
<?php | |
add_action( 'wp_login', 'record_current_datetime_at_login', 10, 2 ); | |
/** | |
* Record Time and Date at login as a readable string. | |
* Save in user meta. | |
* | |
* @param string $user_login login_name | |
* @param object $user WP_User object | |
* @return string Date, time, timezone, offset | |
*/ |
<?php | |
/** | |
* Based on the Register Helper example. | |
* We've added a "buddypress" option for each field | |
* set to the XProfile name we used when setting up | |
* the fields in the BuddyPress extended profile. | |
* If the PMPro BuddyPress Add On is activated | |
* then the fields will be synchronized. | |
* Register Helper: https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* PMPro BuddyPress: https://www.paidmembershipspro.com/add-ons/buddypress-integration/ |
My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.
My solution is to make a general .gitignore
file and add .gitignore.branch_name
files for the branches I want to add specific file exclusion.
I'll use post-checkout hook to copy those .gitignore.branch_name in place
of .git/info/exclude
each time I go to the branch with git checkout branch_name
.
<?php | |
/** | |
* [gettext_pmpro_checkout_city_state_postcode description] | |
* | |
* @param [type] $translated_text [description] | |
* @param [type] $original_text [description] | |
* @param [type] $domain [description] | |
* | |
* @return [type] [description] | |
*/ |