Skip to content

Instantly share code, notes, and snippets.

View greenhornet79's full-sized avatar
👽
Craft

Jeremy Green greenhornet79

👽
Craft
View GitHub Profile
<?php
function leaky_paywall_2checkout_gateway_settings( $settings ) {
if ( !in_array( '2checkout', $settings['payment_gateway'] ) ) {
return;
}
?>
<table class="form-table">
<tr>
<?php
add_filter( 'leaky_paywall_translate_payment_gateway_slug_to_name', 'leaky_paywall_2checkout_gateway_slug', 10, 2 );
function leaky_paywall_2checkout_gateway_slug( $return, $slug ) {
if ( $slug == '2checkout' ) {
$return = '2checkout';
}
<?php
/**
* 2Checkout Payment Gateway Class
*
* @package Leaky Paywall
* @subpackage Classes/Roles
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0.0
*/
<div class="neighborhood-map">
<!-- <div id="map"></div> -->
<script>
var map;
function initMap() {
var mapDiv = document.getElementById('map');
map = new google.maps.Map(mapDiv, {
@greenhornet79
greenhornet79 / custom-fields-leaky-paywall.php
Last active August 22, 2023 16:11
add custom fields to the Leaky Paywall registration form
<?php
// add fields to registration form
add_action( 'leaky_paywall_after_password_registration_field', 'zeen101_custom_registration_fields' );
function zeen101_custom_registration_fields() {
?>
<div class="form-row">
<label>Company</label>
<input type="text" value="" name="company">
</div>
<?php
add_filter( 'leaky_paywall_stripe_button_label', 'zeen101_stripe_button_text' );
function zeen101_stripe_button_text() {
return 'Any Text!'; // return the text you would like to show up in the button
}
@greenhornet79
greenhornet79 / Gruntfile.js
Created July 25, 2016 20:53
a basic Gruntfile for a WordPress theme
module.exports = function(grunt) {
grunt.initConfig({
sass: {
dist: {
options: {
style: 'compressed',
debugInfo: true
},
files: {
@greenhornet79
greenhornet79 / issuem-pdf-filters.php
Created August 2, 2016 13:24
some example use cases for using filters with IssueM Issue-to-PDF
<?php
add_filter( 'issuem_pdf_toc_title', 'zeen101_toc_title' );
function zeen101_toc_title( $toc ) {
return 'List of Articles';
}
add_filter( 'issuem_pdf_styles', 'zeen101_pdf_styles' );
function zeen101_pdf_styles( $styles ) {
$new_styles = 'h2 { color: red; }';
<?php
// didn't work
$term_args = array(
'taxonomy' => 'issuem_issue', // passed as a string
'meta_query' => array(
array(
'key' => 'old_id',
'value' => 123,
'compare' => '='