Skip to content

Instantly share code, notes, and snippets.

View ronalfy's full-sized avatar
🏠
Working from home

Ronald Huereca ronalfy

🏠
Working from home
View GitHub Profile
@ronalfy
ronalfy / pmpro-active-level-dropshadow.css
Created October 27, 2020 16:13
PMPro - Active Level Dropshadow
/* Place the following in your child theme's stylesheet or in the WordPress customizer in Additional CSS.
/* Target Specific Level */
#pmpro_level-11 {
-webkit-box-shadow: 5px 5px 15px 5px #000000;
box-shadow: 5px 5px 15px 5px #000000;
}
/* Target Current Level */
.pmpro_level-current {
-webkit-box-shadow: 5px 5px 15px 5px #000000;
@ronalfy
ronalfy / pmpro-allow-preview-access.php
Created October 27, 2020 14:59
PMPro - Allow Access to Certain Series Non-Members
<?php
/**
* Allow non-logged-in users access to certain series.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
@ronalfy
ronalfy / syntax-highlighting-block-sample.css
Created October 24, 2020 23:01
Syntax Highlighting Block - Sample CSS
code.hljs {
position: relative;
}
code[rel]:not([rel=""]):before {
font-family: Ringside Regular A,Ringside Regular B,Rubik,Lato,Lucida Grande,Lucida Sans Unicode,Tahoma,Sans-Serif;
font-style: normal;
font-weight: 700;
font-size: 12px;
content: attr(rel);
color: #fff;
@ronalfy
ronalfy / syntax-highlighting-block-rel-attribute.php
Created October 24, 2020 22:59
Syntax Highlighting Block - Adding Rel Attribute
<?php
/* Plugin code above */
if ( 0 === $count ) {
$code_start_tag = preg_replace(
'/(?<=<code\b)/',
sprintf( ' rel="%s" class="%s"', esc_attr( $attributes['language'] ), esc_attr( $added_classes ) ),
$code_start_tag,
1
@ronalfy
ronalfy / pmpro-allow-access-feeds.php
Created October 23, 2020 17:11
PMPro - Allow Access to Specific Feeds
<?php
/**
* Allow PMPro access to a specific feed.
* Ref: https://gist.github.com/ocean90/4973288
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@ronalfy
ronalfy / pmpro-canadian-tax-display.php
Created October 21, 2020 14:53
PMPro - Canadian Tax Display
<?php
/**
* 1. Adds 13% tax text to the level cost text.
* 2. Adds 13% tax to invoice if checking out as Canadian customer.
* 3. Adds 13% tax if Canadian to checkout and invoice.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
@ronalfy
ronalfy / pmpro-force-show-renew.php
Created October 19, 2020 18:14
PMPro - Force Renew on Expiring Members When Level Has No Expiration Date
<?php
/**
* Force-shows a renew button for users that have an expiration date and the level has no end date.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function show_renewal_link_expiring_members( $r, $level ) {
@ronalfy
ronalfy / pmpro-add-affiliate-code-mailchimp.php
Last active October 19, 2020 15:06
PMPro - Add Affiliate Code to Mailchimp
<?php
/**
* Add an affiliate merge field to MailChimp.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
@ronalfy
ronalfy / pmpro-allow-post-authors-access-own-content.php
Created October 16, 2020 14:04
PMPro - Allow Post Authors to Access Membership Content
<?php
/**
* Allow authors to access their own protected blog posts.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_allow_authors_access( $has_access, $post, $user, $levels ) {
@ronalfy
ronalfy / pmpro-change-level-recurring.php
Created October 13, 2020 19:39
PMPro - Change Never Label Message for Recurring Levels
<?php
/**
* Changes the output label to Recurring in member/order lists for recurring levels.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**