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
<script type="text/javascript"> | |
var OptinMonsterCustomVariables = function(app) { | |
/** | |
* API method for setting a custom variable. Must be accessed via the app object. | |
* | |
* @param string $key The custom variable key to set. | |
* @param string $value The custom variable value to set for the key. | |
* @return null | |
*/ | |
app.setCustomVariable('foo', 'bar'); |
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( 'pre_get_posts', 'tgm_io_cpt_search' ); | |
/** | |
* This function modifies the main WordPress query to include an array of | |
* post types instead of the default 'post' post type. | |
* | |
* @param object $query The original query. | |
* @return object $query The amended query. | |
*/ | |
function tgm_io_cpt_search( $query ) { |
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
add_action( 'wp_footer', 'tgm_om_force_specific_email_address', 999 ); | |
function tgm_om_force_specific_email_address() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$(document).on('OptinMonsterBeforeOptin', function(e, data){ | |
// Grab the email address submitted by the user. | |
var email = $('#om-' + data.optin).find('input[type="email"]').val(); | |
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( 'gform_ajax_spinner_url', 'tgm_io_custom_gforms_spinner' ); | |
/** | |
* Changes the default Gravity Forms AJAX spinner. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $src The default spinner URL. | |
* @return string $src The new spinner URL. | |
*/ |
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( 'wp_nav_menu_objects', 'tgm_filter_menu_class' ); | |
/** | |
* Filters the first and last nav menu objects in your menus | |
* to add custom classes. | |
* | |
* @since 1.0.0 | |
* | |
* @param object $objects An array of nav menu objects. | |
* @return object $objects Amended array of nav menu objects with new class. |
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
server { | |
listen 80; | |
listen 443 ssl; | |
server_name ~^(?<user>[a-zA-Z0-9-]+)\.example\.com$; | |
location / { | |
resolver 8.8.8.8; | |
rewrite ^([^.]*[^/])$ $1/ permanent; | |
proxy_pass_header Set-Cookie; | |
proxy_pass $scheme://example.com/user/$user$request_uri; |
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
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : '532160876956612', | |
autoLogAppEvents : true, | |
xfbml : true, | |
version : 'v3.2' | |
}); | |
}; |
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( 'jpeg_quality', 'tgm_image_full_quality' ); | |
add_filter( 'wp_editor_set_quality', 'tgm_image_full_quality' ); | |
/** | |
* Filters the image quality for thumbnails to be at the highest ratio possible. | |
* | |
* Supports the new 'wp_editor_set_quality' filter added in WP 3.5. | |
* | |
* @since 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 | |
// If plugins_api isn't available, load the file that holds the function. | |
if ( ! function_exists( 'plugins_api' ) ) { | |
require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); | |
} | |
// Prepare our query. | |
$api = plugins_api( 'query_plugins', | |
array( | |
'user' => 'griffinjt' |