jaredatch / EA-Share-Count

A lean plugin that leverages SharedCount.com API to quickly retrieve, cache, and display various social sharing counts.
85 stars 13 forks source link

Provide more options for theme location #36

Closed billerickson closed 8 years ago

billerickson commented 8 years ago

Right now the before/after content options use Genesis hooks, and is then filterable. We should extend this so it supports non-Genesis sites out of the box.

Sample: https://gist.github.com/billerickson/fe625ac669ff38e184e9

General logic:

  1. If using Genesis, use genesis hooks
  2. If Theme Hook Alliance hooks are found, use those
  3. Fall back to filtering the_content

Issue: the_content is a filter, not a hook. Which means we'll need to return (not echo) the share buttons, include the $content as well, and position it correctly (before/after $content).

I think we should expand the $locations array to include 'hook', 'filter' and 'priority'. Something like this: https://gist.github.com/billerickson/bc10498b20a992f508e7

Then we can either update the display() method to have a return/echo parameter, or just output buffer it.