PodsAPI::save_slug_fix PHP Method

save_slug_fix() public method

Fix Pod / Field post_name to ensure they are exactly as saved (allow multiple posts w/ same post_name)
Since: 2.3.3
public save_slug_fix ( string $slug, integer $post_ID, string $post_status, string $post_type, integer $post_parent, string $original_slug = null ) : string
$slug string Unique slug value
$post_ID integer Post ID
$post_status string Post Status
$post_type string Post Type
$post_parent integer Post Parent ID
$original_slug string Original slug value
return string Final slug value
    public function save_slug_fix($slug, $post_ID, $post_status, $post_type, $post_parent = 0, $original_slug = null)
    {
        if (in_array($post_type, array('_pods_field', '_pods_pod')) && false !== strpos($slug, '-')) {
            $slug = $original_slug;
        }
        return $slug;
    }