Skip to content

Instantly share code, notes, and snippets.

View acal's full-sized avatar

Adam acal

  • At large
  • Greystones, IR
View GitHub Profile
@gausam
gausam / pmpro-customizations.php
Last active April 11, 2024 13:46
Add a custom shortcode to display the payment type on a member's most recent order.
<?php
/**
* This recipe adds a custom shortcode ([mypmpro_payment_type]) custom shortcode
* to display the payment type on a member's most recent order.
*
* 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/
@om4james
om4james / functions.php
Last active April 1, 2024 19:21
Display product description on WooCommerce shop/category pages
<?php
/**
* Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price.
*
* Ref: https://gist.github.com/om4james/9883140
*
* Put this snippet into a child theme's functions.php file
*/
function woocommerce_after_shop_loop_item_title_short_description() {
global $product;
@andrewlimaza
andrewlimaza / my-pmpro-change-admin-email.php
Last active February 28, 2024 11:31
Change the admin email for all Paid Memberships Pro admin emails.
<?php
/**
* Change the email address for all admin related emails in Paid Memberships Pro.
* Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $user_email, $email ){
if( strpos( $email->template, "_admin" ) !== false ) {
$user_email = 'memberadmin@someemail.co';
}
@ipokkel
ipokkel / pmpro-account-bullets-list-recurring-levels.php
Last active February 20, 2024 10:55
List automatically renewing (recurring) membership level in the accounts bullet list.
<?php
/**
* Add a list of recurring levels to the account page bullets.
*
* 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 pmpro_account_bullets_list_recurring_levels() {
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@vanbo
vanbo / wc-css-make-storefront-product-tabs-horizontal
Created October 27, 2017 11:33
WooCommerce: CSS to make Storefront product tabs horizontal again
.product .woocommerce-tabs ul.tabs {
width: 100%;
float: none;
margin-right: 5.8823529412%;
}
.woocommerce div.product .woocommerce-tabs ul.tabs {
list-style: none;
padding: 0 0 0 1em;
margin: 0 0 1.618em;
@coinsandsteeldev
coinsandsteeldev / dialog.html
Last active February 7, 2024 11:23 — forked from arthurattwell/dialog.html
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<!DOCTYPE html>
<html>
<head>
<script>
var data
var formId = 'form'
function drawForm() {
if (!data) return
var outputEl = document.getElementById(formId);
@webaware
webaware / gist:6260468
Last active June 6, 2023 18:00
WooCommerce purchase page add-to-cart with quantity and AJAX, without customising any templates. See blog post for details: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
<?php
/**
* start the customisation
*/
function custom_woo_before_shop_link() {
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2);
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop');
}
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link');
@iqbalrony
iqbalrony / functions.php
Last active May 30, 2023 10:09
How to add/use/register elementor dynamic tag with elementor free version. This is a very easy and useful system of Elementor. Especially I feel the need for this when I use URL control. Help link -> (https://developers.elementor.com/dynamic-tags/)
<?php
/**
* Post URL list
*/
if (!function_exists('prefix_get_all_posts_url')) {
function prefix_get_all_posts_url($posttype = 'post') {
$args = array(
'post_type' => $posttype,
'post_status' => 'publish',
@thewebprincess
thewebprincess / dateform.js
Last active May 15, 2023 19:33
Gravity Forms - Datepicker extension for Date Range Fields
jQuery(function ($) {
var datepickerInArgs = {
minDate: 1,
defaultDate: 0,
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
onClose: function( dateText, inst ) {
var d = $.datepicker.parseDate( inst.settings.dateFormat, dateText );