Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View eri-trabiccolo's full-sized avatar
❤️
@thomasplevy is my buddy

Rocco Aliberti eri-trabiccolo

❤️
@thomasplevy is my buddy
  • Pinerolo (TO), Italy
  • 13:27 (UTC +02:00)
View GitHub Profile
@eri-trabiccolo
eri-trabiccolo / rss_widget_links_new_window.php
Last active January 1, 2024 17:54
open wordpress rss widget links in a new window
<?php // <- do not copy this line.
/**
* Custom access plan button shortcode
*
* Basically identical to the core's 'lifterlms_access_plan_button' shortcode:
* https://lifterlms.com/docs/shortcodes/#lifterlms_access_plan_button
*
* The only difference is that, when used in a Course/Membership, it links to the
* first visbile Access Plan, so the `id` is not a required param anymore.
<?php // <- do not copy this line
$triggers = array(
'achievement_earned',
'certificate_earned',
'course_complete',
'course_track_complete',
'enrollment',
'lesson_complete',
'manual_payment_due',
<?php // <- do not copy this line.
/**
* This will prevent old lessons and lessons created with the course builder to have blocks added.
*/
add_filter(
'llms_blocks_should_migrate_post',
function( $ret, $post_id ) {
return $post_id && 'lesson' === get_post_type( $post_id ) ? false : $ret;
},
<?php // dont copy this to your functios.php file
/**
* Change the maximum number of access plans which can be created for a single course / membership
*
* @param int $cols The number of columns of the pricing table for the `$product`.
* @return int
*/
function my_llms_get_product_pricing_table_columns_count( $cols ) {
// Always organize pricing table in rows of 3 colums, when plans are more than 6.
@eri-trabiccolo
eri-trabiccolo / disable_names_editing_account.php
Created December 8, 2020 11:05
llms - Disable names editing in account
<?php // <- do not copy this line
add_filter(
'lifterlms_get_person_fields',
function ( $fields, $screen ) {
if ( 'account' === $screen ) {
foreach ( $fields as &$field ) {
if ( in_array( $field['id'], array( 'first_name', 'last_name' ), true ) ) {
$field['disabled'] = true;
}
}
@eri-trabiccolo
eri-trabiccolo / llms_remove_sidebar_on_catalogs.php
Created August 13, 2020 12:10
llms_remove_sidebar_on_catalogs
<?php // do not copy this line
remove_action( 'lifterlms_sidebar', 'lifterlms_get_sidebar', 10 );
@eri-trabiccolo
eri-trabiccolo / elementor-pro-llms-certificates-no-header.css
Created July 20, 2020 19:37
No header built with Elementor Pro in LLMS certificates
.single-llms_my_certificate .elementor-location-header,
.single-llms_certificate .elementor-location-header {
display: none;
}
<?php // don't copy this line
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@eri-trabiccolo
eri-trabiccolo / lifterlms-custom-profile-fields-add.php
Last active March 30, 2020 19:20 — forked from actual-saurabh/lifterlms-custom-profile-fields-add.php
Custom Fields added to LifterLMS Registration/Checkout
<?php // don't copy this line to your functions.php file
/**
*
* Create Company Industry as a custom field upon registration or checkout
*
* @param $fields - fields already being registered
* @param $screen - either checkout or registration screen
* @return $fields - array with added field
*/
function add_company_industry_lifterlms ( $fields , $screen ) {