kylephillips / favorites

Simple and flexible favorite buttons for any WordPress post type.
https://favoriteposts.com
223 stars 86 forks source link

[Feature Request]: Add filter for changing the entire button HTML #171

Open tyrann0us opened 1 year ago

tyrann0us commented 1 year ago

Is your feature request related to a problem? Please describe. It's currently not possible to filter the entire HTML of the favorites button. favorites/button/html only affects the button's inner HTML. However, there might situations where you need to, e.g., wrap the entire button in a container for styling purposes.

Describe the desired solution It would be great if the plugin would include a filter like favorites/html that would allow filtering (modifying) the entire HTML of the button, not only the inner HTML.

Describe the alternatives that you have considered Currently, we filter the_content, search for the favorites button and use DOMDocument() to wrap the button(s) in a div. This is very cumbersome, resource-intensive, and error-prone.

Additional context