This file contains hidden or 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 | |
/** | |
* Fancybox image links | |
* @link http://fancyapps.com/fancybox/3/docs/#usage | |
* | |
*/ | |
add_filter( 'the_content', 'ac_the_content_fancybox_image_links', 10 ); // Adjust priorities if necessary | |
add_filter( 'widget_text', 'ac_the_content_fancybox_image_links', 10 ); | |
function ac_the_content_fancybox_image_links( $content ) { |
This file contains hidden or 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 | |
/** | |
* Auto-tag Amazon.com links (v1: Raw) | |
* | |
*/ | |
add_filter( 'the_content', 'ac_auto_tag_amazon_links_v1' ); | |
function ac_auto_tag_amazon_links_v1( $content ) { | |
// Variables |
This file contains hidden or 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 | |
/** | |
* Auto-tag Amazon.com links (v2: Clean) | |
* | |
*/ | |
add_filter( 'the_content', 'ac_auto_tag_amazon_links_v2' ); | |
function ac_auto_tag_amazon_links_v2( $content ) { | |
// Variables |
This file contains hidden or 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
.search-form input[type=search] { | |
line-height: revert; | |
} |
This file contains hidden or 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 | |
/** | |
* Attachment source fields | |
* @link https://kaspars.net/?p=3203 | |
* @link https://www.billerickson.net/?p=3555 | |
* | |
*/ | |
// Add fields | |
add_filter( 'attachment_fields_to_edit', 'ac_attachment_fields_to_edit_source', 10, 2 ); |
This file contains hidden or 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 | |
/** | |
* Filter captioned images to include source link | |
* | |
* @link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/media.php (img_caption_shortcode) | |
* | |
*/ | |
add_filter( 'img_caption_shortcode', 'ac_add_sources_captioned', 10, 3 ); | |
function ac_add_sources_captioned( $empty, $attr, $content ) { |
This file contains hidden or 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 | |
/** | |
* Filter non-captioned images to include source link | |
* | |
*/ | |
add_filter( 'the_content', 'ac_add_sources_non_captioned', 11 ); | |
function ac_add_sources_non_captioned( $content ) { | |
if ( is_singular( array( 'post', ) ) ) { |
This file contains hidden or 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
/* sources */ | |
.image-wrap { | |
position: relative; | |
} | |
figure.wp-caption .image-wrap { | |
display: block; | |
} |
This file contains hidden or 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 | |
/** | |
* Save Jetpack views as post meta: Process Ajax request | |
* | |
*/ | |
add_action( 'wp_ajax_save_views', 'ac_ajax_save_views' ); | |
add_action( 'wp_ajax_nopriv_save_views', 'ac_ajax_save_views' ); | |
function ac_ajax_save_views() { |
This file contains hidden or 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
jQuery(document).ready(function(e) { | |
e.ajax({ | |
method: "POST", | |
url: save_views.ajax_url, | |
data: { | |
post_id: save_views.post_id, | |
nonce: save_views.nonce, | |
action: "save_views" | |
} | |
}); |