Please add this to your theme functions.php
remove_action('geodir_after_edit_post_link', 'geodir_display_post_upgrade_link', 1);
add_action('geodir_after_edit_post_link', 'my_geodir_display_post_upgrade_link', 1);
function my_geodir_display_post_upgrade_link(){
global $post,$preview;
if(!$preview){
if(is_user_logged_in() && $post->post_author == get_current_user_id()){
$post_id = $post->ID;
$post_package_id = isset($post->package_id) ? $post->package_id : '';
if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
$post_id = $_REQUEST['pid'];
if(empty($post_package_id))
$post_package_id = geodir_get_post_meta($post_id,'package_id',true);
}
$postlink = get_permalink( get_option('geodir_add_listing_page') );
$editlink = geodir_getlink($postlink,array('pid'=>$post_id),false);
$post_status = get_post_status( $post_id );
// show renew link before pre expiry days * 2
$post_expire_date = isset($post->expire_date) ? $post->expire_date : '';
$preexpiry_notice = false;
if (get_option('geodir_listing_preexpiry_notice_disable') && get_option('geodir_listing_preexpiry_notice_days')!='' && $post_expire_date != '0000-00-00' && $post_expire_date != '' && strtolower($post_expire_date) != 'never' && strtotime($post_expire_date) > strtotime(date('01-01-1970'))) {
$preexpiry_date = strtotime($post_expire_date) - (DAY_IN_SECONDS * get_option('geodir_listing_preexpiry_notice_days') * 2);
$preexpiry_notice = $preexpiry_date <= strtotime(date('Y-m-d')) ? true : false;
}
$action_link = __('Upgrade Listing', GEODIRPAYMENT_TEXTDOMAIN);
if($post_status == 'draft' || $preexpiry_notice){
$action_link = __('Renew Listing', GEODIRPAYMENT_TEXTDOMAIN);
}
$upgradelink = geodir_getlink($editlink,array('package_id'=>'ADD_YOUR_ID_HERE'),false);
echo '<p class="geodir_upgrade_link"><i class="fa fa-chevron-circle-up"></i> <a href="'.$upgradelink.'">'.$action_link.'</a></p>';
}
}
}
Change where it says ADD_YOUR_ID_HERE with the price package ID needed for the upgrade.
I’ve tested it in our demo and works, however if you have more than one CPT this will not work and will have to be extended with a little extra conditional function.
Let us know,