A collection of various issue filters. See the introduction page about Advanced Searching and the Function reference page.
All Open Bugs
A collection of various issue filters. See the introduction page about Advanced Searching and the Function reference page.
All Open Bugs
module Jekyll | |
module HampusnMoneyFilter | |
def hampusn_money(money) | |
return '' if money.nil? | |
sprintf("%0.02f", money) | |
end | |
end | |
end | |
Liquid::Template.register_filter(Jekyll::HampusnMoneyFilter) |
I hereby claim:
To claim this, I am signing this object:
# Google Analytics & Campaign Monitor | |
# Removes all query params where the key begins with "utm_" | |
# Skip the rewrites if no "utm_*" key exist. | |
RewriteCond %{QUERY_STRING} !(^|&)utm_ [NC] | |
RewriteRule .* - [S=3] | |
# Check and handle first query param. | |
RewriteCond %{QUERY_STRING} ^utm_[A-Za-z0-9]+=[^&]+(.*) [NC] | |
RewriteRule (.*) /$1?%1 [R=301,L] |
<?php | |
/** | |
* Fixes issue where JS is halted on ACF admin pages when WP Media Folder is activated. | |
* | |
* These are the versions of the plugins I had when I tried | |
* - WP Media Folder - 1.0.4 | |
* - Advanced Custom Fields Pro - (5.1.8, 5.2.1) | |
* | |
* |
#!/bin/sh | |
# Called with the credentials for the rpc-username and rpc-password: | |
# ./cleanup-transmission-list.sh username password | |
# Exit early if user and pass is not passed as arguments | |
if [ "$1" == "" ] || [ "$2" == "" ]; then | |
exit 0; | |
fi |
# If you get an error about illegal mixes of collation you might need to force the collation. | |
# SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'; | |
SET @old_url = 'http://www.oldurl.com'; | |
SET @new_url = 'http://www.newurl.com'; | |
UPDATE wp_options SET option_value = replace(option_value, @old_url, @new_url) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, @old_url, @new_url); | |
UPDATE wp_posts SET post_content = replace(post_content, @old_url, @new_url); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, @old_url, @new_url); |
<?php | |
/** | |
* Cleanup Xliffs | |
* | |
* This file can be called through the php cli and clean up xliff files. | |
* | |
* The script takes directories and/or xliff files and removes XML nodes which | |
* matches the XPath query. | |
* | |
* @author Hampus Nordin <[email protected]> |
# Select all posts which are duplicates of a language. | |
# The language parameter is to only select by the new language (not the original duplication language). | |
SET @lang_code = 'da'; | |
SELECT pm.*, p.post_title, p.post_type, icl.language_code | |
FROM wp_postmeta pm | |
INNER JOIN wp_icl_translations icl ON icl.element_id = pm.post_id | |
INNER JOIN wp_posts p ON p.`ID` = pm.post_id | |
WHERE meta_key='_icl_lang_duplicate_of' AND icl.language_code = @lang_code; |
<?php | |
/** | |
* WP Filter which adds acf field value to body classes for all pages but home. | |
* | |
* @see https://codex.wordpress.org/Plugin_API/Filter_Reference/body_class | |
*/ | |
function THEME_NAME_body_class( $classes ) { | |
if ( function_exists( 'get_field' ) && ! is_home() ) { | |
$classes[] = get_field( 'page_background' ); |