kylephillips / favorites

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

Unable to add/utilize custom post types with Favorites button? #112

Open MotiMo opened 5 years ago

MotiMo commented 5 years ago

I am developing a photography site using the Divi theme (3.19.13) and an up-to-date install of WP (5.0.3). I am trying to get Favorites (version 2.3.1) buttons to work with the images within the site and photo galleries.

Currently enabling Favorites on "Media" only places favorites buttons on each image's own "attachment" page, which only seems to be accessible via the backend "Media" tab, then clicking an image, then clicking the link to "View attachment page". Worth noting perhaps, is that unique favorite buttons do appear and function correctly on that attachment page.

Divi uses the .et_pb_image and the .et_pb_gallery_image selectors for most of the images within the website, so I am trying to add these as post types to the post types used by the Favorites plugin but I am unsure of how or where exactly to do so.

I see that postTypeRepository.php gets an array of post types, is there a way for me to add the two classes into that array?

Does anyone have any experience with this type of customization?

Another Note: I have tested Favorites on Posts, Pages and Projects with this theme, and all work well in each context. Unfortunately using these post types is not feasible in this situation for a number of reasons.

Many Thanks for any assistance that can be lent here~