Skip to content

Instantly share code, notes, and snippets.

Avatar
🏢
Working @pronamic

Remco Tolsma remcotolsma

🏢
Working @pronamic
View GitHub Profile
@remcotolsma
remcotolsma / search-wp-hooks.sh
Created Apr 13, 2021
Quick search your project file for WordPress filters and actions.
View search-wp-hooks.sh
grep --recursive --include="*.php" --exclude-dir={bower_components,deploy,node_modules,vendor,wordpress,wp-content} --ignore-case "apply_filters" .
grep --recursive --include="*.php" --exclude-dir={bower_components,deploy,node_modules,vendor,wordpress,wp-content} --ignore-case "do_action" .
@remcotolsma
remcotolsma / single-vacancy.php
Created Mar 17, 2021
Pronamic WordPress EasyCruit plugin display vacancy appetizer
View single-vacancy.php
<?php
$vacancy_appetizer = '';
$xml_string = \simplexml_load_string( \get_post_meta( \get_the_ID(), '_easycruit_vacancy_xml', true ) );
if ( ! empty( $xml_string ) ) {
$vacancy_appetizer = \strval( $xml_string->Versions->Version->Appetizer );
}
@remcotolsma
remcotolsma / orbis-query-companies-number-hosting-subscriptions.sql
Last active Nov 27, 2020
Query companies and the number of hosting subscriptions and users.
View orbis-query-companies-number-hosting-subscriptions.sql
SELECT
company.name,
company_subscriptions.number_support_subbscriptions,
company_users.number_company_users
FROM
orbis_companies AS company
LEFT JOIN
(
SELECT
subscription.company_id,
@remcotolsma
remcotolsma / orbis-query-subscriptions-over-50-quota.sql
Last active Jul 14, 2020
Query subscriptions over 50% time quota.
View orbis-query-subscriptions-over-50-quota.sql
SELECT
company.id AS company_id,
company.name AS company_name,
subscription.id AS subscription_id,
subscription.name AS subscription_name,
product.id AS product_id,
product.name AS product_name,
product.time_per_year,
SUM( timesheet.number_seconds ) AS registered_time,
100 / product.time_per_year * SUM( timesheet.number_seconds ) AS time_percentage,
@remcotolsma
remcotolsma / orbis-query-companies-number-support-subscriptions.sql
Last active Nov 27, 2020
Query companies and the number of WordPress support subscriptions and users.
View orbis-query-companies-number-support-subscriptions.sql
SELECT
company.name,
company_subscriptions.number_support_subbscriptions,
company_users.number_company_users
FROM
orbis_companies AS company
LEFT JOIN
(
SELECT
subscription.company_id,
@remcotolsma
remcotolsma / pronamic-pay-custom-mollie-metadata.php
Created Jul 13, 2020
Custom plugin specific for Pronamic.nl/eu website to add Mollie metadata.
View pronamic-pay-custom-mollie-metadata.php
<?php
/**
* Plugin Name: Pronamic Pay - Custom Mollie metadata
* Plugin URI: https://gist.github.com/remcotolsma/277254ae239641c36b91ec8f8fe0da92
* Description: Custom plugin specific for Pronamic.nl/eu website to add Mollie metadata.
*
* Version: 1.0.0
* Requires at least: 4.7
*
* Author: Pronamic
@remcotolsma
remcotolsma / functions.php
Created Jun 4, 2020
Filter `pronamic_pay_mollie_payment_meta_data`.
View functions.php
<?php
\add_filter( 'pronamic_pay_mollie_payment_meta_data', function( $meta_data, $payment ) {
$data = array();
$customer = $payment->get_customer();
if ( null !== $customer ) {
$vat_number = $customer->get_vat_number();
View svg-test-ie11.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SVG test on IE11</title>
<meta name="description" content="SVG test on IE11.">
<meta name="author" content="Pronamic">
@remcotolsma
remcotolsma / pronamic-pay-export-payments.sql
Last active Feb 3, 2020
Export completed Pronamic Pay payments.
View pronamic-pay-export-payments.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_amount", meta.meta_value, NULL ) ) AS payment_amount,
MAX( IF( meta.meta_key = '_pronamic_payment_currency', meta.meta_value, NULL ) ) AS payment_currency,
MAX( IF( meta.meta_key = '_pronamic_payment_config_id', meta.meta_value, NULL ) ) AS payment_config_id,
MAX( IF( meta.meta_key = '_pronamic_payment_status', meta.meta_value, NULL ) ) AS payment_status,
@remcotolsma
remcotolsma / functions.php
Last active Feb 7, 2020
Pronamic Pay Google Analytics ecommerce tracking item hit name Gravity Forms entry source URL (HelpScout ticket #19062)
View functions.php
<?php
/**
* Custom.
*/
\add_action(
'plugins_loaded',
function() {
/**
* Check for Gravity Forms API.