These are called in extensions. For example, the following module has some hooks:
local M = {}
M.onBeamNGTrigger = function(data)
-- ...
end
<?php | |
include __DIR__ . '/threads.php'; | |
$commands = array(); | |
for ( $i=0; $i<10; $i++ ) { | |
$commands[] = "bash -c 'sleep `shuf -i 1-5 -n 1`; echo $i'"; | |
} |
/*! | |
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill | |
* Copyright (c) 2011 Addy Osmani | |
* Dual licensed under the MIT and GPL licenses. | |
* | |
* Changes: | |
* - Forked by: https://gist.github.com/Swaagie/6221897 (supports moz native) | |
* - Added: methods isVisible, isHidden (based on this.s property) | |
*/ | |
(function () { |
<?php | |
/* | |
Change cancellation to set expiration date for next payment instead of cancelling immediately. | |
Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly). | |
Since 2015-09-21 and PMPro v1.8.5.6 contains code to look up next payment dates via Stripe and PayPal Express APIs. | |
*/ | |
//before cancelling, save the next_payment_timestamp to a global for later use. (Requires PMPro 1.8.5.6 or higher.) | |
function my_pmpro_before_change_membership_level($level_id, $user_id) { |
<?php | |
/** | |
* Cancel subscriptions when a recurring payment fails. | |
* You should also use the PMPro Email Templates Add On to edit the | |
* default billing_failure.html email to mention that users are cancelled upon failure. | |
*/ | |
function my_cancel_subscriptions_on_any_failed_payment( $order ) { | |
pmpro_cancelMembershipLevel( $order->membership_id, $order->user_id ); | |
// ensure cancel at gateway |
<?php | |
/** | |
* Forward PMPro PayPal IPNs to another domain. | |
* Each domain will process the IPNs. The IPN handlers should be setup to ignore | |
* messages that aren't for that site. PMPro does this. | |
* This is useful if you have 2 different sites using the same PayPal account | |
* and the IPN is setup to go to a PMPro site. | |
* Add this to a custom plugin on the PMPro site the IPN hits. | |
* Update the domain/url to the IPN you want to forward to. | |
* The pmprodev_gateway_debug_setup check makes sure this DOESN'T run if you have the |
<?php | |
/** | |
* Code for MAINWP DASH | |
* Save information to the table {table_prefix}_mainwp_wp_options once the site is successfully synced | |
* | |
* @param mixed $pWebsite | |
* @param array $information | |
* | |
* @return void |
<?php | |
/** | |
* Reset the Cron Schedules for Paid Memberships Pro. | |
* | |
* 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/ | |
*/ |
# Sell to specific EU countries only | |
UPDATE `wp_options` SET `option_value`='specific' WHERE option_name = 'woocommerce_allowed_countries'; | |
UPDATE `wp_options` SET `option_value`='a:30:{i:0;s:2:"AT";i:1;s:2:"BE";i:2;s:2:"BG";i:3;s:2:"HR";i:4;s:2:"CY";i:5;s:2:"CZ";i:6;s:2:"DK";i:7;s:2:"EE";i:8;s:2:"FI";i:9;s:2:"FR";i:10;s:2:"DE";i:11;s:2:"GR";i:12;s:2:"HU";i:13;s:2:"IE";i:14;s:2:"IM";i:15;s:2:"IT";i:16;s:2:"JE";i:17;s:2:"LV";i:18;s:2:"LT";i:19;s:2:"LU";i:20;s:2:"MT";i:21;s:2:"NL";i:22;s:2:"PL";i:23;s:2:"PT";i:24;s:2:"RO";i:25;s:2:"SK";i:26;s:2:"SI";i:27;s:2:"ES";i:28;s:2:"SE";i:29;s:2:"GB";}' WHERE option_name = 'woocommerce_specific_allowed_countries'; | |
# Ship to specific EU countries only | |
UPDATE `wp_options` SET `option_value`='specific' WHERE option_name = 'woocommerce_ship_to_countries'; | |
UPDATE `wp_options` SET `option_value`='a:30:{i:0;s:2:"AT";i:1;s:2:"BE";i:2;s:2:"BG";i:3;s:2:"HR";i:4;s:2:"CY";i:5;s:2:"CZ";i:6;s:2:"DK";i:7;s:2:"EE";i:8;s:2:"FI";i:9;s:2:"FR";i:10;s:2:"DE";i:11;s:2:"GR";i:12;s:2:"HU";i:13 |