Support

Account

Home Forums ACF PRO Using location slugs in ACF php export code Reply To: Using location slugs in ACF php export code

  • Wait, now that I’m thinking about this (should have done this earliers, but is just popped up :-)) I can use a WP function to return the post id by using the slug!

    function get_ID_by_slug($page_slug) {
    	$page = get_page_by_path($page_slug);
    	if ($page) {
    		return $page->ID;
    	} 
    	else {
    		return null;
    	}
    }