Json::entries_custom_field PHP Method

entries_custom_field() protected method

protected entries_custom_field ( $entry_id, $field, $field_data, $entry, $tagdata = ' ' )
  protected function entries_custom_field($entry_id, $field, $field_data, $entry, $tagdata = ' ')
  {
    ee()->load->add_package_path(ee()->api_channel_fields->ft_paths[$field['field_type']], FALSE);

    ee()->api_channel_fields->setup_handler($field['field_id']);

    ee()->api_channel_fields->apply('_init', array(array(
      'row' => $entry,
      'content_id' => $entry['entry_id'],
      'content_type' => 'channel',
    )));

    $field_data = ee()->api_channel_fields->apply('pre_process', array($field_data));

    if (ee()->api_channel_fields->check_method_exists('replace_tag'))
    {
      require_once PATH_THIRD.'json/libraries/Json_Template.php';

      $template = new Json_Template();

      $field_data = ee()->api_channel_fields->apply('replace_tag', array($field_data, array(), $tagdata));

      if ($template->variables)
      {
        $field_data = $template->variables;
      }

      unset($template);
    }

    ee()->load->remove_package_path(ee()->api_channel_fields->ft_paths[$field['field_type']]);

    return $field_data;
  }