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 / gist:6a4ffa622a9dcb6519af3527f3a5c513
Created August 23, 2025 06:43
Alerts DLX Pattern Code
<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading">Welcome to the AlertsDLX Demo</h1>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Scroll down to view all of the variations of this post. You can use blocks or shortcodes to display AlertsDLX. Edit this page to view the blocks in action.</p>
<!-- /wp:paragraph -->
<!-- wp:mediaron/alerts-dlx-chakra {"alertType":"warning","alertTitle":"Sample Alert","maximumWidth":"475","icon":"\u003csvg xmlns=\u0022http://www.w3.org/2000/svg\u0022 height=\u002224\u0022 width=\u002224\u0022 viewBox=\u00220 0 24 24\u0022\u003e\u003cpath d=\u0022M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z\u0022\u003e\u003c/path\u003e\u003c/svg\u003e","uniqueId":"alerts-dlx-a8b97e03","closeButtonEnabled":true,"className":"is-style-warning"} -->
<!-- wp:paragraph {"placeholder
@ronalfy
ronalfy / highlight-share-posts-only.php
Last active December 4, 2023 06:48
Highlight and Share - Enable Posts Only
<?php
// Can use Code Snippets to insert: https://wordpress.org/plugins/code-snippets/
// Only enable on single posts (blog posts).
add_filter(
'has_enable_content',
function( $load_content ) {
if ( is_single() ) {
return true;
}
return false;
@ronalfy
ronalfy / appsero-init-class.php
Created May 30, 2022 15:32
Appsero Initialization Class
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Installation instructions: https://appsero.com/docs/appsero-developers-guide/appsero-client/
*/
/**
@ronalfy
ronalfy / conditional-theme-json.php
Last active March 30, 2022 13:43
Conditionally Load theme.json
<?php
/**
* Conditionally load the default theme.json file.
*
* Assumes directory structure of /theme-name/skins/skin-name/theme.json (see switch statement below).
*
* @package coaching-pro
*/
/**
### Keybase proof
I hereby claim:
* I am ronalfy on github.
* I am ronaldhuereca (https://keybase.io/ronaldhuereca) on keybase.
* I have a public key ASBKxn9O1p_ffHRRGdcYVEjImU2uPutZWFD9l-lSz70HHAo
To claim this, I am signing this object:
@ronalfy
ronalfy / pmpro-uk-taxes.php
Created November 23, 2020 21:48
Gist UK Taxes on Checkout / Invoice / Etc.
<?php
/**
* 1. Adds 20% tax text to the level cost text.
* 2. Adds 20% tax to invoice if checking out as UK customer.
* 3. Adds 20% tax if UK 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-deregister-jquery.php
Created November 20, 2020 20:50
PMPro - De-register jQuery and Assign it new value
<?php
/**
* Deregister core WordPress scripts and use CDN jQuery instead.
*
* Not recommended for wide-use. May neeed to update this when WordPress 5.6 is released.
*
* 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-jquery-dequeue.php
Created November 20, 2020 19:57
PMPro - Prevent Multiple jQuery Scripts From Running
<?php
/**
* Dequeue's theme's custom JS handler, forces jQuery as a dependency. Testing code is commented out below.
*
* 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_dequeue_script_in_theme() {
@ronalfy
ronalfy / pmpro-restrict-categories-sub-site.php
Created November 20, 2020 14:49
PMPro - Restrict Categories on Sub-site in a Multisite Network
<?php
/**
* Restrict categories on the sub-site of a MS network.
* Install as an mu-plugin (advanced users only)
*/
function my_pmpro_member_pmpro_has_membership_access_filter( $access, $post, $user, $levels ) {
// If main site, leave alone.
if ( is_main_site() || is_admin() ) {
return $access;
@ronalfy
ronalfy / pmpro-acf-restrict-domains-rh.php
Created November 19, 2020 14:13
PMPro - ACF Pro - Restrict Domains Level with Register Helper
<?php
/**
* Requires ACF Pro. Registers an options page and restricts by level and domain. Add approved domains via Register helper (can be optional)
*
* !important
* Change 12 to level you'd like to have the domain field on.
* Change 13 to level ID you'd like to restrict.
*
* 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.