Skip to content

Instantly share code, notes, and snippets.

Michael Dorchain mdorchain

  • Philipppines
Block or report user

Report or block mdorchain

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
ChrisFlannagan / geodistance.php
Created Oct 13, 2017
Calculate distance between to coordinates of latitude and longitude using the WP REST API and return posts ordered by distance from user's coordinates
View geodistance.php
* Heavily borrowed from:
class CoordinatesTable extends DB {
protected $db_option = "coordinates_db";
bekarice / registration-order-link-for-woocommerce.php
Last active Sep 16, 2019
Automatically link previous orders to new WooCommerce customer accounts upon registration
View registration-order-link-for-woocommerce.php
glueckpress / wp-rocket-affiliatewp-cookies-cache.php
Last active Mar 26, 2019
[WordPress][WP Rocket] Creates cached files based on dynamic cookies for AffiliateWP. (WP Rocket 2.7+ required.)
View wp-rocket-affiliatewp-cookies-cache.php
* Plugin Name: WP Rocket | AffiliateWP Cookie Cache
* Description: Creates a specific cache for each affiliate ref ID.
* Author: WP Rocket Support Team
* Author URI:
* Plugin URI:
* License: GNU General Public License v3 or later
* License URI:
mathetos / plugin.php
Last active Nov 16, 2019
Dependent Plugin Activation/Deactivation and Alert
View plugin.php
* Dependent Plugin Activation/Deactivation
* Sources:
* 1.
* 2.
scottopolis / thumbnail-featured-url-wp-api.php
Last active Apr 10, 2016
Add post thumbnail (featured image) url to WP-API response
View thumbnail-featured-url-wp-api.php
scottopolis / wp-api-user-meta.php
Last active Aug 18, 2019
Add user meta to the WP-API
View wp-api-user-meta.php
/* Adds all user meta to the /wp-json/wp/v2/user/[id] endpoint */
function sb_user_meta( $data, $field_name, $request ) {
if( $data['id'] ){
$user_meta = get_user_meta( $data['id'] );
if ( !$user_meta ) {
return new WP_Error( 'No user meta found', 'No user meta found', array( 'status' => 404 ) );
scottopolis / wp-api-custom-taxonomies.php
Created Oct 27, 2015
Add custom taxonomies to the WP-API
View wp-api-custom-taxonomies.php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
add_action( 'init', 'ms_add_tax_to_api', 30 );
ultimatemember / gist:08c7f3369f49021cb749
Last active Apr 4, 2018
How to stop registration using Ultimate Member action hooks
View gist:08c7f3369f49021cb749
You need to hook into um_submit_form_errors_hook with a
priority over 10.
You can stop registration here if the customer_code field does not
match the value you want "ALLOWED_VALUE" in this example
You can’t perform that action at this time.