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
<FilesMatch ".pdf$"> | |
Header set X-Robots-Tag "noindex" | |
</FilesMatch> |
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 | |
// Helper class to generate responsive image HTML from an id or array | |
class cameronjonesweb_generate_image { | |
public $output; | |
function __construct( $image, $size = 'full' ) { | |
if( is_array( $image ) ) { | |
// It's an array |
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($) { | |
function new_map( $el ) { | |
// var | |
var $markers = $el.find('.marker'); | |
// vars | |
var args = { |
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 | |
function cameronjonesweb_facebook_page_slug( $url ) { | |
$slug = str_replace( | |
array( | |
'https://facebook.com/', 'https://www.facebook.com/', 'http://facebook.com/', 'http://www.facebook.com/' | |
), | |
'', | |
rtrim( |
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 | |
function cameronjonesweb_bp_mark_notifications_read() { | |
// Get the action. | |
$action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; | |
$nonce = !empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; | |
$id = !empty( $_GET['notification_id'] ) ? $_GET['notification_id'] : ''; | |
// Bail if no action or no ID. |
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
var head = document.getElementsByTagName( 'head' )[0]; | |
// Save the original method | |
var insertBefore = head.insertBefore; | |
// Replace it! | |
head.insertBefore = function( newElement, referenceElement ) { | |
if ( newElement.href && newElement.href.indexOf( 'https://fonts.googleapis.com/css?family=Roboto' ) === 0 ) { | |
return; |
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( 'pre_get_posts', 'cameronjonesweb_404_tag_archives' ); | |
function cameronjonesweb_404_tag_archives( $query ) { | |
if( $query->is_main_query() && $query->is_tag() ) { | |
$query->set_404(); | |
status_header( 404 ); | |
} | |
} |
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 | |
/** | |
* Updates the Salesforce API endpoint for the Gravity Forms Salesforce Add-On | |
* From the article Fixing The Gravity Forms Salesforce Add-On For WordPress: https://cameronjonesweb.com.au/blog/fixing-the-gravity-forms-salesforce-add-on-for-wordpress/ | |
* | |
* @link https://help.salesforce.com/articleView?id=Updating-the-Web-to-Case-and-Web-to-Lead-Endpoint-URL&language=en_US&type=1 | |
* @param string $sub The current subdomain (www or test). | |
* @param bool $test Whether it's in test mode or not. | |
* @return string The new subdomain | |
*/ |
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( 'rss2_item', 'cameronjonesweb_add_post_thumbnail_to_rss' ); | |
function cameronjonesweb_add_post_thumbnail_to_rss() { | |
if ( has_post_thumbnail() ) { | |
printf( | |
"\t" . '<media:content url="%1$s" type="%2$s" />' . "\n", | |
esc_url( get_the_post_thumbnail_url() ), | |
esc_attr( get_post_mime_type( get_post_thumbnail_id() ) ) |