Check if WP API function exists before enqueuing JS stuff