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 / remove-simple-toc-headline-block.php
Created January 7, 2026 19:00
Simple TOC - Remove GB 2.0 Text Blocks
<?php
/**
* Removes GB 2.0 from Simple TOC.
*/
add_filter(
'simpletoc_supported_third_party_blocks',
function ( $supported_third_party_blocks ) {
// Find generateblocks/text and remove it.
$index = array_search( 'generateblocks/text', $supported_third_party_blocks, true );
if ( false !== $index ) {
@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 / pmpro-add-fields-checkout-send-data-zapier.php
Last active October 24, 2024 06:41
Paid Memberships Pro - Add Fields to Checkout and Pass Data to Zapier
<?php
function my_pmprorh_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
// Define the fields.
$fields = array();
$fields[] = new PMProRH_Field(
@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 / pmpro-add-on-learn-dash.php
Last active September 15, 2023 12:26
Paid Memberships Pro - Add On Packages Plus LearnDash
<?php
global $pmpro_addon_pages_for_courses;
// 28 is the page ID; 24 is the course ID.
// 30 is the page ID; 26 is the course ID.
$pmpro_addon_pages_for_courses = array(
28 => 24,
30 => 26,
);
function pmproap_learndash_template_redirect()
{
@ronalfy
ronalfy / pmpro-bulk-approve-members.php
Created November 12, 2020 18:06
PMPro - Bulk Approve Existing Members
<?php
/**
* Bulk approve existing members.
*
* 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-add-rh-approvals.php
Created October 29, 2020 14:12
PMPro - Add RH to Approval Emails
<?php
/**
* Adds Register Helper Fields to the Approvals Email.
*
* 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-mmpu-override-checkout-page.php
Created November 6, 2020 22:49
PMPro - MMPU Override Checkout Page
<?php
/**
* The recipe checks for a /paid-memberships-pro/pages/checkout.php in the child theme
* Please keep checkout.php up to date as MMPU is updated.
*
* 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-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/
*/
/**
@ronalfy
ronalfy / pmpro-extra-fields.php
Created October 12, 2020 16:23
PMPro - Add Extra Fields - Sync with Add User from Admin
<?php
/**
* Modified customer gist. Adds profile fields and saves them.
* Compatible with Add User from Admin Add-On
*
* 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/
*/