Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created September 24, 2012 16:23
Show Gist options
  • Select an option

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

Select an option

Save objectivehtml/3776820 to your computer and use it in GitHub Desktop.
Get author_id using polymorphic parameters with Channel Data
public function author_id()
{
$params = array(
'username',
'screen_name',
'email'
);
$where = array();
foreach($params as $param)
{
if($value = $this->param($param))
{
$where[$param] = $value;
}
}
$member = $this->EE->channel_data->get_members(array(
'where' => $where
))->row_array();
return isset($member['member_id']) ? $member['member_id'] : NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment