Skip to content

Instantly share code, notes, and snippets.

View langlers's full-sized avatar

Daniel Bond | Langlers WebWorks langlers

View GitHub Profile
@strangerstudios
strangerstudios / pmpro_is_level_expiring_soon_yes_on_levels_page.php
Created September 13, 2017 14:21
Show a renew link instead of Your Level for recurring subscriptions on the levels page with Paid Memberships Pro.
/*
Show a renew link instead of Your Level
for recurring subscriptions on the levels page.
Add this code to a custom plugin.
*/
function pmpro_is_level_expiring_soon_yes_on_levels_page($expiring) {
//only adjust this on the levels page so we don't mess anything up
global $pmpro_pages;
if(!is_admin() && !empty($pmpro_pages) && is_page($pmpro_pages['levels']))
@strangerstudios
strangerstudios / pmpro-customizations.php
Created August 3, 2017 15:46
A blank plugin file for customizations to your Paid Memberships Pro setup including a stylesheet for customizations.
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/
@strangerstudios
strangerstudios / pmpro_hide_account_page_until_validated.php
Last active July 21, 2023 15:56
Hide the PMPro Account page until a user confirms their email address via the PMPro Email Confirmation addon.
/*
Add this function to a custom plugin.
Update your membership confirmation text then to include a reminder about confirming your email.
*/
function pmpro_hide_account_page_until_validated() {
//bail if pmpro or the email confirmation addon is not loaded
if(!function_exists('pmpro_getMembershipLevelForUser') || !function_exists('pmproec_isEmailConfirmationLevel'))
return;
@lots0logs
lots0logs / child-theme-functions-php-snippet.php
Created February 10, 2017 22:33
WordPress :: Divi Builder :: Filterable Portfolio :: Change Post Order
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_setup() {
if ( class_exists( 'ET_Builder_Module_Filterable_Portfolio' ) && file_exists( 'my-main-modules.php' ) ) {
get_template_part( 'my-main-modules' );
$et_pb_filterable_portfolio = new My_ET_Builder_Module_Filterable_Portfolio();
remove_shortcode('et_pb_filterable_portfolio');
add_shortcode('et_pb_filterable_portfolio', array( $et_pb_filterable_portfolio, '_shortcode_callback' ) );
@strangerstudios
strangerstudios / my_pmpro_dashboard_report.php
Last active April 14, 2022 03:37 — forked from andrewlimaza/my_custom_dashboards.php
Show Membership Reports on the WordPress Admin Dashboard
<?php
/*
Show Members Reports on the WordPress Admin Dashboard.
Update the my_pmpro_dashboard_report() function to remove or add core or custom reports.
*/
//Create a Dashboard Reports widget for Paid Memberships Pro
function add_my_report_dashboard() {
if( ! defined( 'PMPRO_DIR' ) || ! current_user_can( 'manage_options' ) )
{
@lots0logs
lots0logs / child-theme-functions-php-snippet.php
Created September 14, 2016 22:52
WordPress :: Divi Builder :: Fullwidth Portfolio Module :: Custom Thumbnail Size
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_image_sizes( $sizes ) {
$sizes['200x200'] = 'my-et-pb-portfolio-image';
return $sizes;
}
add_filter( 'et_theme_image_sizes', 'my_et_theme_image_sizes' );
@MaruscaGabriel
MaruscaGabriel / functions.php
Last active November 5, 2021 01:40
WordPress (DIVI) code snippets
<?php
// Limit the number of revisions to 3
add_filter( 'wp_revisions_to_keep', 'divi_limit_revisions', 10, 2 );
function divi_limit_revisions( $num ) {
$num = 3;
return $num;
}
//Disable Emoji
@MaruscaGabriel
MaruscaGabriel / code.js
Last active November 5, 2021 01:42
DIVI theme JavaScript code snippets
//Open external links into new tab
<script type="text/javascript">
jQuery('a').filter(function () {
return this.hostname != window.location.hostname;
}).attr('target', '_blank');
</script>
//Adding Fly-in Animations To Any Divi Section, Row and Module
//thanks to Gino Quiroz : https://quiroz.co/adding-fly-in-animations-to-any-divi-module/
//Below are the CSS Class groups for each animation.
@lots0logs
lots0logs / child-theme-functions-php-snippet.php
Created March 2, 2016 21:00
WordPress :: Divi Builder :: Contact Form Module :: Change the "From:" address to the same domain as website.
<?php
function my_et_contact_page_headers( $headers, $contact_name, $contact_email ) {
/* ==================================================================
* >>>> Replace the "your-domain" below with your actual domain. <<<<
* ==================================================================
*/ $from = 'noreply@your-domain.com';
$headers[0] = "From: \"{$contact_name}\" <{$from}>";
@lots0logs
lots0logs / child-functions-php-snippet.php
Last active March 13, 2020 18:38
WordPress :: Divi Builder :: Contact Form Module :: Change the submit button text
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_setup() {
if ( class_exists( 'ET_Builder_Module_Contact_Form' ) ) {
get_template_part( 'my-main-modules' );
$et_pb_contact = new My_ET_Builder_Module_Contact_Form();
remove_shortcode('et_pb_contact');