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 | |
/** | |
* This example shows how to filter the 'This product has sold out.' text. | |
* If the translation domain is 'wpsc' it will replace the text with 'This product is no longer available.'. | |
*/ | |
add_filter( 'gettext', 'my_gettext_filter' ); | |
function my_gettext_filter( $translated_text, $text, $domain ) { | |
if ( 'wpsc' == $domain ) { | |
switch ( $text ) { |
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 | |
/** | |
* Hide Plugin Update Messages for this plugin | |
*/ | |
add_filter( 'http_request_args', 'hide_plugin_update_messages', 10, 2 ); | |
function hide_plugin_update_messages( $r, $url ) { | |
if ( 0 === strpos( $url, 'http://api.wordpress.org/plugins/update-check/' ) ) { | |
$my_plugin = plugin_basename( __FILE__ ); | |
$plugins = unserialize( $r['body']['plugins'] ); |
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 | |
/** | |
* Remove Posts Page Admin Notice | |
* | |
* Since WordPress 4.2, if you edit the page used as the Posts page | |
* and there was no content saved for that page, the editor functionality | |
* is removed and a message displayed instead. | |
* | |
* The following function re-enables the editor on this page. |
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 | |
$args = array( | |
'post_type' => 'attachment', | |
'post_mime_type' => 'application/pdf,application/msword', | |
'numberposts' => -1, | |
'post_status' => null, | |
'post_parent' => $post->ID, | |
'orderby' => 'menu_order', | |
'order' => 'ASC' | |
); |
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 wpml-{ICL_LANGUAGE_CODE} class to body tag | |
*/ | |
function wpml_body_class( $classes ) { | |
if ( defined( 'ICL_LANGUAGE_CODE' ) ) | |
$classes[] = 'wpml-' . strtolower( ICL_LANGUAGE_CODE ); | |
return $classes; | |
} | |
add_filter( 'body_class', 'wpml_body_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
/** | |
* Add extra category fields | |
* Requires the Term_Taxonomymeta plugin | |
*/ | |
function add_category_excerpt_fields( $category ) { | |
if ( ! class_exists( 'Term_Taxonomymeta' ) ) | |
return; | |
$category_metadata = get_metadata( 'term_taxonomy', $category->term_id, 'excerpt', true ); | |
?> | |
<tr class="form-field"> |
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
diff --git a/sitepress.class.php b/sitepress.class.php | |
index d5b2802be9a9de8b64244e889328b3e2ad776c9b..ecd861877107f00a7b111c3477bd65df12e86e6f 100644 | |
--- a/sitepress.class.php | |
+++ b/sitepress.class.php | |
@@ -2775,7 +2775,7 @@ class SitePress{ | |
// if the list of values has 1 element run update | |
// this will either ADD or UPDATE the value on the translated document | |
if(count($meta_values) == 1){ |
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
/** | |
* Fix scale on rotate issue | |
*/ | |
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) { | |
var viewportmeta = document.querySelector('meta[name="viewport"]'); | |
if (viewportmeta) { | |
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0'; | |
document.body.addEventListener('gesturestart', function () { | |
viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6'; | |
}, false); |
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 text scaling on rotate for iPad/iPhone */ | |
html { -webkit-text-size-adjust: none; } |
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
/* Detach carousel - same as destroy but content is not removed */ | |
detach: function() { | |
this.stopAutoplay(); | |
this._itemsWrapper.unbind(this._downEvent); | |
$(document).unbind(this._moveEvent).unbind(this._upEvent); | |
$(window).unbind(this._resizeEvent); | |
if(this.settings.keyboardNav) { | |
$(document).unbind("keydown.touchcarousel"); | |
} | |
if (this._dragContainer.parent().hasClass('touchcarousel-wrapper')) { |