Skip to content

Instantly share code, notes, and snippets.

@zackkatz
zackkatz / gv-calendar-remove-time-display.php
Last active May 24, 2020 20:35 — forked from rafaehlers/gv_calendar_remove_time_display.php
Gravity Forms Calendar - Prevent time from being displayed in the calendar
<?php // DO NOT COPY THIS LINE
/**
* Remove the time from being displayed on a GravityView calendar
*
* @see https://docs.gravityview.co/category/647-calendar
*
* @param array $calendar_options Array of FullCalendar options
*
* @return mixed
@damiencarbery
damiencarbery / wc-defer-order-completed-emails.php
Created March 30, 2020 13:46
Defer Order Complete emails - Defer Order Complete emails for 10 minutes. DOES NOT WORK.
<?php
/*
Plugin Name: Defer Order Complete emails
Plugin URI: https://www.damiencarbery.com/
Description: Defer Order Complete emails for a few minutes.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
@phillipwilhelm
phillipwilhelm / woocommerce-ajax.php
Created March 28, 2020 23:59 — forked from qutek/woocommerce-ajax.php
[Wordpress] [Woocommerce] WooCommerce Ajax Handlers
<?php
/**
* WooCommerce Ajax Handlers
*
* Handles AJAX requests via wp_ajax hook (both admin and front-end events)
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/** Frontend AJAX events **************************************************/
<?php
/**
* Gravity Perks // Multi-page Navigation + Easy Passthrough // Make Pages Navigable When Editing Entry
* http://gravitywiz.com/documentation/gravity-forms-multi-page-navigation/
* http://gravitywiz.com/documentation/gravity-forms-easy-passthrough/
*
* When repopulating an entry into a form for editing via Easy Passthrough and
* [this snippet](https://gravitywiz.com/edit-gravity-forms-entries-on-the-front-end/), make all pages navigable if
* Multi-page Navigation is enabled for the given form and configured to allow navigating to any completed page.
*/
@phillipwilhelm
phillipwilhelm / functions.php
Created March 28, 2020 04:48 — forked from Idealien/functions.php
Gravity Flow - Step Assignee - Bypass "re-assignment" with email change
<?php
add_filter( 'gravityflow_step_assignees', 'bypass_step_assignee_on_email_change', 10, 2 );
function bypass_step_assignee_on_email_change( $assignees, $step ) {
//Update with the ID of your specific step to apply the bypass against
if ( $step->get_id() == '76' ) {
if ( isset( $_POST['gforms_save_entry'] ) && count( $_POST ) > 0 ) {
$reset = false;
if ( $assignees ) {
foreach ( $assignees as $key => $assignee ) {
@rafaehlers
rafaehlers / gv_calendar_remove_time_display.php
Created March 27, 2020 23:23
// GravityView Calendar add-on - Prevent time from being displayed in the Calendar
<?php // DO NOT COPY THIS LINE
function gv_calendar_remove_time_display( $calendar_options ){
$calendar_options['displayEventTime'] = false; // Disable displaying of time
return $calendar_options;
}
add_filter('gravityview/calendar/options', 'gv_calendar_remove_time_display', 10, 1);
@salvatorecapolupo
salvatorecapolupo / htaccess sal
Last active February 9, 2021 14:41
HTACCESS standard senza HTTP/HTTPS mixed content - https://capolooper.it
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
<?php
/**
* Gravity Perks // Limit Submissions + Nested Forms // Scope Limit Feeds to Current Parent Entry
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/
*/
add_action( 'gpls_before_query', function( $ruletest ) {
global $wpdb;
// Update "123" to your child form ID.
if( $ruletest->form_id == 123 && class_exists( 'GPNF_Session' ) && $parent_form_id = rgpost( 'gpnf_parent_form_id' ) ) {
<?php
/**
* Gravity Perks // eCommerce Fields // Show GPECF Fields in WooCommerce Cart Item Description
* http://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/
*/
add_action( 'init', function() {
remove_filter( 'gform_pre_render', array( gp_ecommerce_fields(), 'add_wc_class_to_hide_fields_in_cart_description' ) );
}, 11 );
@ziadoz
ziadoz / pdf-img.sh
Created March 11, 2020 00:04
Extract Images From PDF / Build PDF From Images / Remove PDF White Margins (Ubuntu)
#!/usr/bin/env bash
# Extract images from a PDF: https://askubuntu.com/questions/117143/command-line-tool-to-bulk-extract-images-from-a-pdf
sudo apt-get install poppler-utils
pdfimages -all input.pdf images/image
# Build PDF from images: https://stackoverflow.com/questions/8955425/how-can-i-convert-a-series-of-images-to-a-pdf-from-the-command-line-on-linux
sudo apt install img2pdf
img2pdf --output d.pdf images/image*.jpg