Category Archives: PHP

WordPress : How to disable updates for a specific plugin

If you modified a plugin and don’t want it to appear in the updates list, use this function from rniswonger in your functions.php

/**
 * Prevent update notification for plugin
 * http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
 * Place in theme functions.php or at bottom of wp-config.php
 */
 function disable_plugin_updates( $value ) {
    $pluginsToDisable = [
        'plugin-folder/plugin.php',
        'plugin-folder2/plugin2.php'
    ];
    if ( isset($value) && is_object($value) ) {
        foreach ($pluginsToDisable as $plugin) {
            if ( isset( $value->response[$plugin] ) ) {
                unset( $value->response[$plugin] );
            }
        }
    }
    return $value;
}
add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' );

Magpie RSS and special characters

Your site is not in english and you are trying to import an RSS feed by using the excellent Magpie RSS ? If the feed language is in french for instance you’ll probably get weird characters coming up on your display page.

The solution is pretty simple. Go in the folder where Magpie RSS is installed and look for rss_fetch.inc

Around line 357 set the default output and input encoding to UTF-8 like this :

  if ( !defined('MAGPIE_OUTPUT_ENCODING') ) {
 define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
 }
 
 if ( !defined('MAGPIE_INPUT_ENCODING') ) {
 define('MAGPIE_INPUT_ENCODING', 'UTF-8');
 }