Skip to content

Instantly share code, notes, and snippets.

Remco Tolsma remcotolsma

Block or report user

Report or block remcotolsma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@remcotolsma
remcotolsma / functions.php
Created Oct 9, 2019
Update Gravity Forms currency EUR.
View functions.php
<?php
/**
* Update Gravity Forms currency EUR.
*
* @link https://www.pronamic.nl/2012/04/gravity-forms-euro-teken-voor-bedrag/
* @link https://docs.gravityforms.com/gform_currencies/#1-update-euro
*/
\add_filter(
'gform_currencies',
@remcotolsma
remcotolsma / test.php
Created Aug 29, 2019
Providers and slots GEO query WordPress.
View test.php
<?php
$providers_query = new WP_Query(
array(
'post_type' => 'provider',
'tax_query' => array(
array(
'taxonomy' => 'country',
'field' => 'slug',
'terms' => 'nl',
@remcotolsma
remcotolsma / index.php
Created Jul 31, 2019
Holiday Media widgets test WordPress
View index.php
<?php
define( 'WP_USE_THEMES', false );
require '../wp-blog-header.php';
/**
* Holiday Media.
*
* @link https://gitlab.com/pronamic-plugins/holiday-media-booking-widget/blob/develop/holiday-media-booking-widget.php
@remcotolsma
remcotolsma / rcp-update-2-to-3-fixer.php
Last active Jul 23, 2019
Restrict Content Pro update 2 to 3 fixer
View rcp-update-2-to-3-fixer.php
<?php
define( 'WP_USE_THEMES', false );
require '../../../../wp-blog-header.php';
global $wpdb;
$query = new WP_Query(
array(
View lookup-query-henk.sql
SELECT
t.*,
d.*
FROM
(
SELECT
`company_code`,
`company_name` as `CompanyName`,
`period_start_date` as `Begindatum`,
`period_end_date` as `Einddatum`,
View dita-addresses-to-json.php
<?php
$addresses = array();
foreach ( $data as $item ) {
$addresses[] = (object) array(
'company' => 'First Company',
'address' => 'First Address',
'city' => 'First City',
'postcode' => 'First Postal',
@remcotolsma
remcotolsma / tbs-posts-accommodation-ids.sql
Created Feb 8, 2019
Tommy Booking Support WordPress posts accommodation ID's.
View tbs-posts-accommodation-ids.sql
SELECT
wp_posts.ID,
wp_posts.post_title,
wp_postmeta.meta_value
FROM
wp_posts
LEFT JOIN
wp_postmeta
ON (
wp_posts.ID = wp_postmeta.post_id
@remcotolsma
remcotolsma / index.php
Created Jan 28, 2019
Check if all files within a range are in a directory.
View index.php
<?php
global $argv;
$dir = __DIR__;
if ( isset( $argv[1] ) ) {
$dir = $argv[1];
}
@remcotolsma
remcotolsma / functions.php
Last active Jan 25, 2019
WordPress query to retrieve active Pronamic Pay subscriptions for current user.
View functions.php
<?php
/**
* WordPress query to retrieve active Pronamic Pay subscriptions for current user.
*
* @link https://github.com/ApiGen/ApiGen
* @link https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query
* @link https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query
*/
@remcotolsma
remcotolsma / pronamic-pay-export-payments-gravityforms-entries.sql
Last active Jan 3, 2019
Export completed Pronamic Pay payments with Gravity Forms entries.
View pronamic-pay-export-payments-gravityforms-entries.sql
SELECT
post.ID,
post.post_title,
post.post_date,
post.post_status,
MAX( IF( meta.meta_key = "_pronamic_payment_description", meta.meta_value, NULL ) ) AS payment_description,
MAX( IF( meta.meta_key = "_pronamic_payment_entrance_code", meta.meta_value, NULL ) ) AS payment_entrance_code,
MAX( IF( meta.meta_key = "_pronamic_payment_language", meta.meta_value, NULL ) ) AS payment_language ,
MAX( IF( meta.meta_key = "_pronamic_payment_amount", meta.meta_value, NULL ) ) AS payment_amount,
MAX( IF( meta.meta_key = '_pronamic_payment_currency', meta.meta_value, NULL ) ) AS payment_currency,
You can’t perform that action at this time.