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 | |
/** | |
* Get attachment file type extension | |
* | |
* Requires that you have the attachment id | |
* See this post http://jeremyjaymes.com/display-attach…ordpress-theme/ for more explanation | |
*/ | |
//* Assumes we're in a loop and have our attachment id already | |
$file_url = wp_get_attachment_url( $file_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
<?php | |
/** | |
* Force resizes and caches images without needing to add_image_size() and bloat the /upoads/ dir | |
* | |
* Most code is completely based on Konstantin Kovshenin's image-shortcode.php | |
* https://gist.github.com/kovshenin/1984363 | |
* | |
* Expects the params similar to wp_get_attachment_image_src() | |
* http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src | |
* |
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
// Prevent Multi Submit on WPCF7 forms | |
add_action( 'wp_footer', 'mycustom_wp_footer' ); | |
function mycustom_wp_footer() { | |
?> | |
<script type="text/javascript"> | |
var disableSubmit = false; | |
jQuery('input.wpcf7-submit[type="submit"]').click(function() { | |
jQuery(':input[type="submit"]').attr('value',"Sending...") |
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 (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
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
/** | |
* Prevent username enumeration via REST API | |
* | |
* This function allows normal (anonymous) access to the REST API, but makes | |
* sure that site usernames are not exposed through it. This code can be added | |
* to your theme's functions.php file. | |
* | |
* Note: there has been a report that this code may interfere with JetPack's operation. | |
* See https://twitter.com/PrysmcatBooks/status/1082022370817261568 | |
*/ |
OlderNewer