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 translate_woocommerce($translation, $text, $domain) { | |
if ($domain == 'woocommerce') { | |
switch ($text) { | |
case 'SKU': | |
$translation = 'Product Code'; | |
break; | |
case 'SKU:': | |
$translation = 'Product Code:'; | |
break; |
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() { | |
// Define constructor | |
this.Modal = function() { | |
// Create global element references | |
this.closeButton = null; | |
this.modal = null; | |
this.overlay = null; | |
// Determine proper prefix |
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
/** | |
* Get information about available image sizes | |
*/ | |
function get_image_sizes($size = '') | |
{ | |
global $_wp_additional_image_sizes; | |
$sizes = array(); | |
$get_intermediate_image_sizes = get_intermediate_image_sizes(); |
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 _remove_script_version( $src ){ | |
$parts = explode( '?ver', $src ); | |
return $parts[0]; | |
} | |
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
add_filter( 'style_loader_src', '_remove_script_version', 15, 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
<?php | |
$article_string = file_get_contents( $url ); | |
$article_string = preg_replace_callback('/<!\[CDATA\[(.*)\]\]>/', 'filter_xml', $article_string); | |
$article_xml = simplexml_load_string($article_string); | |
$namespaces = $article_xml->getNamespaces(true); // get namespaces | |
function filter_xml($matches) { | |
return trim(htmlspecialchars($matches[1])); | |
} | |
// | |
// foreach ($article_xml->channel->item as $item) { |
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_filter( 'wpcf7_validate_text', 'your_validation_filter_func', 10, 2 ); | |
add_filter( 'wpcf7_validate_text*', 'your_validation_filter_func', 10, 2 ); | |
function your_validation_filter_func( $result, $tag ) { | |
$type = $tag['type']; | |
$name = $tag['name']; | |
if ( 'your-id-number-field' == $name ) { | |
$the_value = $_POST[$name]; |
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
/** | |
* Hide update notifications | |
*/ | |
add_action('admin_menu','wphidenag'); | |
function wphidenag() { | |
remove_action( 'admin_notices', 'update_nag', 3 ); | |
} | |
/** | |
* Hide plugin update notifications |
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
// REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN | |
global $user_login; | |
get_currentuserinfo(); | |
if (!current_user_can('update_plugins')) { // checks to see if current user can update plugins | |
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); | |
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); | |
} |
NewerOlder