Skip to content

Instantly share code, notes, and snippets.

@bradvin
bradvin / freemius-checkout-ga-fb-tracking.js
Last active August 18, 2020 10:53 — forked from vovafeldman/freemius-checkout-ga-fb-tracking.js
Tracking purchases with Google Analytics and Facebook for Freemius Checkout
//
// Gist was kindly contributed by @jamesckemp from @iconicwp. Thanks!
//
handler.open({
...
purchaseCompleted: function( response ) {
var trial = response.purchase.trial_ends !== null,
total = trial ? 0 : response.purchase.initial_amount.toString(),
productName = 'FooGallery',
@bradvin
bradvin / get_current_post_type.php
Created March 5, 2012 18:48 — forked from mjangda/get_current_post_type.php
Get the current post_type context in the WordPress admin.
<?php
/**
* gets the current post type in the WordPress Admin
*/
function get_current_post_type() {
global $post, $typenow, $current_screen;
//we have a post so we can just get the post type from that
if ( $post && $post->post_type )
return $post->post_type;