This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'optin_monster_api_output', 'tgm_om_filter_lightbox_by_category', 10, 4 ); | |
function tgm_om_filter_lightbox_by_category( $optins, $optin, $fields, $post_id ) { | |
// If in a particular category, remove the lightbox. | |
$cat_exc = 362; // Replace with the category ID to target. | |
$slug = 'sjdfhsjakdkg'; // Replace with the unique slug for the lightbox you want to remove. | |
$categories = wp_get_object_terms( $post_id, 'category', array( 'fields' => 'ids' ) ); | |
foreach ( (array) $categories as $category_id ) { | |
if ( $category_id && $category_id == $cat_exc && in_array( $slug, $optins ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: TGM API Helper | |
* Plugin URI: https://thomasgriffin.io | |
* Description: Whitelists the plugins to be loaded during API requests to reduce overhead. | |
* Author: Thomas Griffin | |
* Author URI: https://thomasgriffin.io | |
* Version: 1.0.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_loaded', 'tgm_soliloquy_set_slides_to_published' ); | |
function tgm_soliloquy_set_slides_to_published() { | |
if ( ! class_exists( 'Soliloquy' ) ) { | |
return; | |
} | |
$sliders = Soliloquy::get_instance()->_get_sliders(); | |
foreach ( (array) $sliders as $slider ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not include this opening tag. | |
add_filter( 'optin_monster_data', 'tgm_om_disable_tracking' ); | |
function tgm_om_disable_tracking( $data ) { | |
$data['tracked'] = true; | |
return $data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
tinymce.create('tinymce.plugins.typekit', { | |
init: function(ed, url) { | |
ed.onPreInit.add(function(ed) { | |
// Get the iframe. | |
var doc = ed.getDoc(); | |
// Create the script to inject into the header asynchronously. | |
var typekit = 'xxxxxx', // PLACE YOUR TYPEKIT KIT ID HERE! | |
jscript = "!function(){var t={kitId:\"" + typekit + "\"},e=!1,a=document.createElement(\"script\");a.src=\"//use.typekit.net/\"+t.kitId+\".js\",a.type=\"text/javascript\",a.async=\"true\",a.onload=a.onreadystatechange=function(){var a=this.readyState;if(!(e||a&&\"complete\"!=a&&\"loaded\"!=a)){e=!0;try{Typekit.load(t)}catch(c){}}};var c=document.getElementsByTagName(\"script\")[0];c.parentNode.insertBefore(a,c)}();"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not include this opening PHP tag. | |
add_filter( 'mce_external_plugins', 'tgm_io_typekit_plugin' ); | |
/** | |
* Adds an external TinyMCE plugin to be loaded into the TinyMCE editor. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $plugins Default array of plugins to be loaded by TinyMCE. | |
* @return array $plugins Amended array of plugins to be loaded by TinyMCE. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
tinymce.create('tinymce.plugins.typekit', { | |
init: function(ed, url) { | |
ed.onPreInit.add(function(ed) { | |
// Get the iframe. | |
var doc = ed.getDoc(); | |
// Create the script to inject into the header asynchronously. | |
var jscript = "(function() { | |
var config = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'optin_monster_pre_optin_mailchimp', 'tgm_om_custom_mailchimp_data', 10, 4 ); | |
/** | |
* Filter the data sent to Mailchimp. | |
* | |
* See here for more info on what is passed: https://apidocs.mailchimp.com/api/2.0/lists/subscribe.php | |
* | |
* @param array $data Array of data being sent to Mailchimp. | |
* @param array $lead Array of lead data captured from the optin submission. | |
* @param string $list_id The unique list ID to subscribe the lead to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'get_comments_link', 'tgm_io_change_comment_link', 99 ); | |
/** | |
* Filters the comment link to have the hash match a different | |
* comment system, such as Disqus. | |
* | |
* @since 1.0.0 | |
* | |
* @global object $post The current post object. | |
* @param string $link The default comment link. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'optin_monster_data', 'tgm_om_turn_off_tracking' ); | |
function tgm_om_turn_off_tracking( $data ) { | |
$data['tracked'] = true; | |
return $data; | |
} |