This file contains hidden or 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
wp plugin deactivate enhanced-media-library | |
wp plugin activate filebird | |
wp search-replace 'media_category' 'nt_wmc_folder' | |
for term_id in $(wp term list nt_wmc_folder --field=term_id) | |
do | |
wp term meta set $term_id folder_type default | |
wp term meta set $term_id folder_position 0 |
This file contains hidden or 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 empty paragraphs | |
* | |
* @param string $content the HTML markup of content | |
* | |
* @return string the HTML markup of content | |
*/ | |
add_filter('the_content', function ($content) { |
This file contains hidden or 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
/** | |
* Redirect .html URLs that cause 404 | |
*/ | |
add_action('template_redirect', function() { | |
if (is_404()) { | |
// get url without GET parameters | |
$url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); |
This file contains hidden or 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 correct UTF8 orderby for post_title (äöå) | |
* | |
* @param string $orderby ordering clause for query | |
* | |
* @return string ordering clause for query | |
*/ | |
add_filter('posts_orderby', function($orderby) use ($wpdb) { | |
if(strstr($orderby, 'post_title')) { |
This file contains hidden or 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 | |
$municipalities_by_region = array( | |
'Ahvenanmaa' => array( | |
35 => 'Brändö', | |
43 => 'Eckerö', | |
60 => 'Finström', | |
62 => 'Föglö', | |
65 => 'Geta', |