JoeHana
9/13/2013 - 12:12 AM

Listing ID auto prefix

Listing ID auto prefix

<?php

/**
 * Listing ID auto prefix
 */

add_filter( 'wpsight_listing_id', 'custom_listing_id' );

function custom_listing_id( $id ) {

    // Get ID prefix
    $prefix = wpsight_get_option( 'listing_id' );

    // Check if ID already contains prefix

    if( strpos( $id, $prefix ) == false ) {

        // If not, add it
        $id = $prefix . $id;

    }

    return $id;     

}