Skip to content

Instantly share code, notes, and snippets.

@AbijeetP
AbijeetP / acf-repeater-get-post-meta.php
Created February 17, 2019 15:24 — forked from palicko/acf-repeater-get-post-meta
ACF repeater via get_post_meta()
<?php
// Returns array with repeater subfields and its values
function repeater_get_post_meta( $repeater_key, $post_id, $sub_field_keys ) {
if ( ! $post_id ) {
$post_id = get_the_ID();
}
// get repeater field
$repeater = get_post_meta( get_the_ID(), $repeater_key, true );
// Making an HTTP Post call, and passing the URL
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("content-type", "application/json");
HttpClient httpClient = new DefaultHttpClient(getHttpParameterObj(4000,4000));
// Building the JSON object.
JSONObject data = new JSONObject();