Answers.Body: <p>The checkboxes will only show up if there is at least one available <a href="http://buildwithcraft.com/docs/plugins/element-actions" rel="nofollow">element action</a> for the current source.</p>
  
  <p>Element actions are defined by element types’ <a href="http://buildwithcraft.com/classreference/elementtypes/IElementType#getAvailableActions-detail" rel="nofollow">getAvailableActions()</a> methods, which will vary their response based on the <code>$source</code> that is passed in.</p>
  
  <p>In <a href="http://buildwithcraft.com/classreference/elementtypes/EntryElementType" rel="nofollow">EntryElementType’s</a> case, if an unrecognized <code>$source</code> is passed in, then no actions will be returned.</p>
  
  <p>However, <a href="http://buildwithcraft.com/classreference/elementtypes/EntryElementType#getAvailableActions-detail" rel="nofollow">EntryElementType::getAvailableActions()</a> does have a hook called <a href="http://buildwithcraft.com/docs/plugins/hooks-reference#addEntryActions" rel="nofollow">addEntryActions</a>, which gives plugins the opportunity to add additional actions to its response.</p>
  
  <p>So on top of using the <a href="http://buildwithcraft.com/docs/plugins/hooks-reference#modifyEntrySources" rel="nofollow">modifyEntrySources</a> hook, you can also use the addEntryActions hook to provide the actions that your custom source should have.</p>
  
  <pre class="lang-php prettyprint-override"><code>public function addEntryActions($source)
  {
      if ($source == 'myCustomSourceKey')
      {
          $elementType = craft()-&gt;elements-&gt;getElementType(ElementType::Entry);
          return $elementType-&gt;getAvailableActions('section:X');
      }
  }
  </code></pre>
  
  <p>(Replace <code>X</code> with the ID of a section you want to mimic.)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-20T22:51:20.617Z
Answers.Text: Ahhhh! Awesome, thanks Brandon! Much appreciated :)
Answers.UserDisplayName: jonleesmith
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-20T23:56:10.437Z
Answers.Text: Hey Brandon, I just tried this out. With a help from looking in the resources tab in chrome developer tools and the handy die() function, the addEntryActions doesn't seem to be running on my custom source keys, runs on the system sources though fine...
Answers.UserDisplayName: jonleesmith
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-21T00:49:56.113Z
Answers.Text: Ah yes, sorry you're right. I'll tweak that for the next release!
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-20T22:46:43.347Z
Answers.LastActivityDate: 2015-02-20T22:46:43.347Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>Im using the modifyEntrySources hook in my plugin, when I view the entries based on my custom criteria it doesn't show the checkboxes for element actions, is there a way to get these back or is this a bug? </p>
  
Tags: <entries><plugins><hook>
Title: Element Actions for Entries being viewed from modifyEntrySources
ThreadText: # Element Actions for Entries being viewed from modifyEntrySources
  
  (Asked by: username_0 on 2015-02-19)
  
  Im using the modifyEntrySources hook in my plugin, when I view the entries based on my custom criteria it doesn't show the checkboxes for element actions, is there a way to get these back or is this a bug?
  
  **Tags:** entries, plugins, hook
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-02-20. Score: 4 | Accepted answer
  
  The checkboxes will only show up if there is at least one available [element action](http://buildwithcraft.com/docs/plugins/element-actions) for the current source.
  
  Element actions are defined by element types’ [getAvailableActions()](http://buildwithcraft.com/classreference/elementtypes/IElementType#getAvailableActions-detail) methods, which will vary their response based on the `$source` that is passed in.
  
  In [EntryElementType’s](http://buildwithcraft.com/classreference/elementtypes/EntryElementType) case, if an unrecognized `$source` is passed in, then no actions will be returned.
  
  However, [EntryElementType::getAvailableActions()](http://buildwithcraft.com/classreference/elementtypes/EntryElementType#getAvailableActions-detail) does have a hook called [addEntryActions](http://buildwithcraft.com/docs/plugins/hooks-reference#addEntryActions), which gives plugins the opportunity to add additional actions to its response.
  
  So on top of using the [modifyEntrySources](http://buildwithcraft.com/docs/plugins/hooks-reference#modifyEntrySources) hook, you can also use the addEntryActions hook to provide the actions that your custom source should have.
  
  ```php
  public function addEntryActions($source)
  {
      if ($source == 'myCustomSourceKey')
      {
          $elementType = craft()->elements->getElementType(ElementType::Entry);
          return $elementType->getAvailableActions('section:X');
      }
  }
  
  ```
  
  (Replace `X` with the ID of a section you want to mimic.)
  
  > **Comments:**
  > **username_0**: Ahhhh! Awesome, thanks username_1! Much appreciated :)  
  > **username_0**: Hey username_1, I just tried this out. With a help from looking in the resources tab in chrome developer tools and the handy die() function, the addEntryActions doesn't seem to be running on my custom source keys, runs on the system sources though fine...  
  > **username_1**: Ah yes, sorry you're right. I'll tweak that for the next release!  
  
  ---
  
  