You can get a post's ID from a URL with url_to_postid() . Just pass it the URL to get the ID back: $link = get_sub_field( 'offer_link' ); $id = url_to_postid( $link['url'] );
You can get a post's ID from a URL with url_to_postid() . Just pass it the URL to get the ID back: $link = get_sub_field( 'offer_link' ); $id = url_to_postid( $link['url'] );