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
$(".image-upload-button").on("click", function (e) { | |
var $area = $(this).closest(".image-upload-area"), | |
send_to_editor_backup = window.send_to_editor; | |
tb_show('', 'media-upload.php?type=image&TB_iframe=true'); | |
window.send_to_editor = function (html) { | |
var imgUrl = $("img", html).attr("src"); | |
$area.find(".image-url").val(imgUrl); |
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 | |
/** | |
* Filter allowed HTML elements. | |
* | |
* @param $allowedposttags | |
* @param $context | |
* | |
* @return array | |
*/ | |
function prefix_filter_allowed_html( $allowedposttags, $context ) { |
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 support for <select> <option> to Bootstrap plugins | |
* | |
* @link http://getbootstrap.com/javascript/ | |
*/ | |
$(".js-select-toggle").on("change", function () { | |
var $select = $(this); | |
$select.find("option").each(function () { | |
var $option = $(this), |
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
// Checkbox | |
.checkbox-custom { | |
position: absolute; | |
opacity: 0; | |
&__icon-state { | |
display: inline-block; | |
margin-right: 5px; | |
padding: 0; | |
width: 20px; |
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 | |
/** | |
* Flickr Gallery shortcode | |
* | |
* @author Damian Wajer | |
* @param $atts | |
* @return string | |
*/ | |
function prefix_flickr_gallery_shortcode( $atts ) { | |
$a = shortcode_atts( 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
<?php | |
/** | |
* Clear the cache on specific page | |
*/ | |
if ( function_exists( 'wp_cache_post_change' ) ) { | |
$GLOBALS["super_cache_enabled"] = 1; | |
wp_cache_post_change( $post_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
function clearFormElements( element ) { | |
// clear form elements | |
$( element ).find( ":input" ).each( function () { | |
switch ( this.type ) { | |
case "text": | |
case "email": | |
case "number": | |
case "password": | |
case "tel": | |
case "date": |
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
/* thanks to: http://www.catswhocode.com/blog/manage-wordpress-comments-using-sql */ | |
/* Delete all spam comments */ | |
DELETE from wp_comments WHERE comment_approved = 'spam'; | |
/* Delete all comments between two dates */ | |
DELETE FROM wp_comments | |
WHERE comment_date > '2013-11-15 01:10:04' | |
AND comment_date <= '2013-11-20 00:10:04'; |
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 | |
/** | |
* limit_text_length | |
* Function to limit text length by characters. | |
* | |
* @param string $string | |
* @param int $length | |
* | |
* @return string | |
*/ |