Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created September 7, 2012 12:52
Show Gist options
  • Select an option

  • Save objectivehtml/3666017 to your computer and use it in GitHub Desktop.

Select an option

Save objectivehtml/3666017 to your computer and use it in GitHub Desktop.
Channel Entries API with Channel Data
<?php
$entry = array(
'title' => $this->post('title'),
'status' => 'Unpaid',
'allow_comments' => 'y',
'entry_description' => $this->post('entry_description'),
'entry_client_name' => $this->post('entry_client_name'),
'entry_delivery_method' => $this->post('entry_delivery_method'),
'entry_url' => $this->post('entry_url'),
'entry_upload_url' => $this->post('entry_upload_url'),
'entry_competition_id' => $this->post('entry_competition'),
'entry_medium' => $medium_name,
'entry_category' => $category_name,
);
$entry = $this->EE->channel_data->utility->prepare_entry($channel, $entry);
$entry['category'] = array($category);
$entry_id = $this->EE->channel_data->utility->submit_entry($channel, $entry);
if(is_array($entry_id))
{
$this->EE->ouput->show_user_errors('entry', $entry_id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment