PHP

Remove Update Notification for WordPress Plugins

Sometimes, you may have a reason not to update certain plugins. Maybe the plugin was heavily customized or the newer version asks you to pay to continue using it (in my case this is the reason).

Because of that, you may not want to received notification to update the plugins. You may accidentally update the plugins if the notification was turned off.

To remove update notification. Add the following code in main plugins php file.

add_filter('site_transient_update_plugins', 'remove_update_nag');
function remove_update_nag($value) {
 if ( isset( $value ) && is_object( $value ) )
 unset( $value->response[plugin_basename(__FILE__)] );
 return $value;
}

Remove Address & Description in Recent Listing Sidebox in phpMyDirectory

Recent Listing Sidebox in phpMyDirectory is very long because it contains listing address & short description. I prefer short sidebox hence I want to remove listing address & short description.

To do this, need to edit 2 files.

/includes/sidebox_data.php

Under the “// RECENT” section find the following

$results[$key]['link'] = $PMDR->get('Listings')->getURL($value['id'],$value['friendly_url']);

Add the following code directly above it.

$results[$key]['nodetails'] = 1;

blocks/sidebox_listings.tpl file in template directory

Find the following

<span class="listing_sidebox_location"><?php echo $this->escape($listing['address']); ?></span><br />
<span class="listing_sidebox_description"><?php echo $this->escape_html($listing['description_short']); ?></span><br />

Replace it with the code below

<?php if($listing['nodetails'] != 1) { ?>
<span class="listing_sidebox_location"><?php echo $this->escape($listing['address']); ?></span><br />
<span class="listing_sidebox_description"><?php echo $this->escape_html($listing['description_short']); ?></span><br />
<?php } ?>