Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function sync_tags() {
- if( ! $this->params) $this->get_params($api_url, $api_key );
- $available_tags = array();
- $offset = 0;
- $continue = true;
- while ($continue == true) {
- $request = "https://api.ontraport.com/1/objects?objectID=14&start=" . $offset;
- $response = wp_remote_get($request, $this->params);
- $body_json = json_decode($response['body'], true);
- foreach ($body_json['data'] as $row){
- $available_tags[$row['tag_id']] = $row['tag_name'];
- }
- if(count($body_json['data'] < 50))
- $continue = false;
- $offset = $offset + 50;
- }
- wp_fusion()->settings->set( 'available_tags', $available_tags );
- return $available_tags;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement