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
<?php
add_filter( 'gform_pagination_event_category', 'gf_form_category_pagination_category', 10, 4 );
function gf_form_category_pagination_category( $category_name, $form, $source_page_number, $current_page_number ) {
return 'Forms';
}
add_filter( 'gform_pagination_event_action', 'gf_form_action_pagination_action', 10, 4 );
function gf_form_action_pagination_action( $action_name, $form, $source_page_number, $current_page_number ) {
return "Submission";
@ronalfy
ronalfy / eum.php
Created November 1, 2018 16:51
Overriding Lock Filter in EUM
<?php
add_filter( 'eum_force_updates_disable_lock', '__return_true' );
@ronalfy
ronalfy / allow-subscribers-user-profile-picture-gutenberg.php
Last active April 7, 2022 21:15
Allow Subscribers in User Profile Picture and Gutenberg
<?php
// For User Profile Picture
add_filter( 'mpp_gutenberg_user_role', function( $role ) {
return 'subscribers';
} );
// For Gutenberg
add_filter( 'rest_user_query', function( $args, $r ) {
if( isset( $args['who'] ) && 'authors' == $args['who'] ) {
$args['who'] = 'subscribers';
@ronalfy
ronalfy / mediaron-beaver-builder-copyright-shortcode.txt
Last active October 2, 2019 12:30
Beaver Builder Copyright Shortcode
@ronalfy
ronalfy / pluginbuddy-s3-shortcode.php
Created April 16, 2019 15:02
PluginBuddy S3 Shortcode
[s3 access_key='30404039292022' secret_key='NQX' bucket='wpajax' expires='3600' file='wordpress-and-ajax_double.pdf.zip']Text Here[/s3]
@ronalfy
ronalfy / wp_body_open_instructions_for_metronet_tag_manager.php
Created May 24, 2019 22:03
WordPress 5.2 Body Open Instructions for Metronet Tag Manager
<body>
<?php
// Make sure wp_body_open function exists for backwards compatibility
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'body_open' );
}
?>
<~-- rest of body goes here -->
@ronalfy
ronalfy / pmpro-exclude-pages-from-sitemap.php
Last active February 17, 2020 14:36
Exclude Paid Membership Pro My Account page and child pages from Yoast XML Sitemap
<?php
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'pmpro_my_account_exclude', 10, 1 );
/**
* Exclude page 'my-account' and child pages.
*
* @param array $excluded_ids The excluded post ids.
* @return array Updated exlucded IDs.
*/
function pmpro_my_account_exclude( $excluded_ids = array() ) {
$maybe_page_ids = wp_cache_get( 'pmpro_exclude_pages' );
@ronalfy
ronalfy / pmpro-advanced-levels-shortcode.html
Created February 17, 2020 16:23
Paid Memberships Pro Advanced Levels Page Shortcode
[pmpro_advanced_levels levels="1,2,3" expiration="false" layout="compare_table" compare='Public Forum,1,1,1;WaaSP.Club Group,1,1,1;Private Group & Forum,0,1,1;Vendor Sub-groups,0,1,1;Friendship Connections,0,1,1;Private Messaging,0,1,1;Livestream Events,0,1,1;Knowledgebase,0,1,1;Enhanced Profile,0,1,1;Training Webinars,0,0,1;Private Meeting Room,0,0,1;Technical Guidance,0,0,1;<a href="https://waaspclub.software/">WaaSPClub.Software</a>,0,0,1;Create Blog Articles,0,0,1;Create Landing Pages,0,0,1']
@ronalfy
ronalfy / limit-posts-pmpro-series.php
Created February 19, 2020 16:06
Limit Shown Posts with Paid Memberships Pro Series Add On
<?php
function my_pmpro_series_limit_posts_shown( $post_list, $series_object ) {
if ( ! is_user_logged_in() ) {
return $post_list;
}
global $current_user;
$member_days = pmpro_getMemberDays( $current_user->ID );
$posts_to_display = array();
foreach ( $post_list as $sp ) {
$posts_to_display[] = $sp;
@ronalfy
ronalfy / pmpro-limit-pages-post-protect.php
Created February 24, 2020 17:51
PMPro Limit Pages Add On for Protecting Posts
<?php
function pmpro_lpv_add_my_post_types( $post_types ) {
$post_types[] = 'post';
// Add pages to post type array to restrict Limit Post Views.
$post_types[] = 'page';
// $post_types[] = 'custom-post-type'; | Example of how you can add more $post_types
return $post_types;
}