Function Reference: geodir_send_listing_edited_notification

Summary

Send notification when a listing has been edited by it’s author.

Global Values

$gd_notified_edited
(array) (required) Array of post ID which has post edited notification set.

Default: None
$gd_set_listing_edited
(array) (required) Array of post ID which needs to notify admin on post edited.

Default: None

Package

GeoDirectory

Parameters

$post_ID
(int) (required) Post ID.

Default: None
$data
(array) (required) Post data.

Default: None

Change Log

Since: 1.6.24

Filters

‘geodir_notify_on_listing_edited’ [Line: 5323]

Source File

geodir_send_listing_edited_notification() is located in geodirectory-functions/general_functions.php [Line: 5299]

Source Code

function geodir_send_listing_edited_notification( $post_ID, $data ) {
    global $gd_notified_edited, $gd_set_listing_edited;
    
    if ( !empty( $gd_set_listing_edited[ $post_ID ] ) && empty( $gd_notified_edited[ $post_ID ] ) ) {
        if ( !empty( $gd_notified_edited ) ) {
            $gd_notified_edited = array();
        }
        $gd_notified_edited[ $post_ID ] = true;
        
        $from_email   = get_option( 'site_email' );
        $from_name    = get_site_emailName();
        $to_email     = get_option( 'admin_email' );
        $to_name      = get_option( 'name' );
        $message_type = 'listing_edited';

        $notify_edited = true;
        /**
         * Send notification when listing edited by author?
         *
         * @since 1.6.0
         *
         * @param bool $notify_edited Notify on listing edited by author?
         * @param object $post        The current post object.
         */
        $notify_edited = apply_filters( 'geodir_notify_on_listing_edited', $notify_edited, $post_ID );

        if ( $notify_edited ) {
            geodir_sendEmail( $from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID );
        }
    }
}