Maintaining Changes After Update

This topic contains 5 replies, has 3 voices, and was last updated by  Stiofan O’Connor 6 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #395711

    jbissitt
    Expired Member
    Post count: 90

    Hi

    I am making changes to a line for the #comments# shortcode for notifications for send to friend and website enquiry.

    I make changes to geodirectory/geodirectory functions/custom functions.php and edit the below line

    $client_message = $frnd_comments;
    $client_message .= ‘<br>’ . __( ‘From :’, ‘geodirectory’ ) . ‘ ‘ . $yourname . ‘<br>’ . __( ‘Phone :’, ‘geodirectory’ ) . ‘ ‘ . $inq_phone . ‘<br>’ . __( ‘Email :’, ‘geodirectory’ ) . ‘ ‘ . $youremail . ‘<br><br>’ . __( ‘Sent from’, ‘geodirectory’ ) . ‘ – <b>‘ . get_option( ‘blogname’ ) . ‘</b>.’;

    The bit in bold I remove because i dont need sent from because its giving the page title which is wrong.

    As it stands, whenever gD is updated changes are lost.

    Can I copy to theme functions so updates arent lost if so which part shoudl be copied many thanks

    Best Regards

    #395807

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’m sorry, but that not possible if you edit plugin files. Only templates can be used via themes and that’s not a template.

    I asked to Stiofan to let us know if there is a hook for it, but I doubt it.

    Thanks

    #395898

    jbissitt
    Expired Member
    Post count: 90

    Ok no problem
    Will need to take out with each update

    #395911

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Not tested but this code snippet should work, you can install the code snippet pluign and add it.

    
    
    add_filter('geodir_inquiry_email_msg','_my_geodir_inquiry_email_msg',10,1);
    function _my_geodir_inquiry_email_msg($client_message){
    
    	$client_message = str_replace( __( 'Sent from', 'geodirectory' ) . ' - <b><a href="' . trailingslashit( home_url() ) . '">' . get_option( 'blogname' ) . '</a></b>.','',$client_message);
    
        return $client_message;
    }

    Thanks,

    Stiofan

    #395919

    jbissitt
    Expired Member
    Post count: 90

    That works great
    Thanks Stiofan

    #395928

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket