Created
June 20, 2013 01:53
-
-
Save dreadfullyposh/5819725 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // if field_id_4 is your playa field it works like this | |
| $this->EE->load->library('api'); | |
| $this->EE->api->instantiate('channel_entries'); | |
| $this->EE->api->instantiate('channel_fields'); | |
| $data = array( | |
| 'title' => $entry->title, | |
| 'field_id_4' => '', | |
| 'field_ft_4' => 'none', | |
| 'entry_date' => time(), | |
| 'edit_date' => time() | |
| ); | |
| $data['field_id_4']['selections'] = array($site->entry_id); | |
| $this->EE->api_channel_fields->setup_entry_settings(2, $data); | |
| $this->EE->api_channel_entries->submit_new_entry(2, $data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment