• Resolved lssi2024

    (@lssi2024)


    Hi Francesco,

    We are attempting to display an eBook using the Simple Ebook Viewer and BuddyPress User Profile Tabs Creator Pro by buddydevs. The viewer works correctly on a blank page; however, when we place the shortcode within a custom tab, the content does not appear.

    Could you please advise on what might be preventing it from rendering in the tab? If you need any additional details from our side, we would be happy to provide them.

    We already contacted buddydevs and they responded the following:

    “Please contact the author of Ebook Viewer as ask them how to enable the viewer outside normal page/post content. We simply run do_shortcode, so the issues lies with the shortcode if a specific shortcode is not rendering.”

    We look forward to your guidance.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Francesco Martini

    (@wrcisco)

    Hi, probably the issue is that the plugin can handle only one viewer per page, so there is a guard in the function that sets up the resources for the plugin to work:

    if (!is_singular()) {
    return;
    }

    If the page is not of a single post (https://developer.wordpress.org/reference/functions/is_singular/), the resources are not loaded.

    I’m not familiar with the BuddyPress’s custom tabs (and the link you provided redirects me towards a login page), so I’m not sure if you can configure them to meet the is_singular() requirement. If you can, that would be the optimal solution.

    Otherwise, if you are sure that there will always be only one viewer in that page, an ugly hack would be to remove the guard directly from the source code of the function (the function is conditionally_enqueue_assets in the file includes/simebv-viewer.php). Obviously, any subsequent update of the plugin will overwrite this change.

    I’m working in these days at a new version of the plugin, if you confirm that my guess is correct and this is the issue, I’ll try to look at it for a fix, but I can’t make any promises about precise timings.

    Thread Starter lssi2024

    (@lssi2024)

    Hi Francesco,

    I shared your response with the BuddyDev team, and they replied with the following:

    “Hi Danny,
    Thank you for sharing their response. As I expected, the issue lies with the shortcode. Manually editing the shortcode is not advised. Please ask him to provide a filter — I can then help you with some code to enable it on BuddyPress profile pages. If we manually edit their code, it will be lost in the next release.”

    Could you please provide the filter they’re requesting so we can implement a proper solution?

    Thank you for your help.

    Plugin Author Francesco Martini

    (@wrcisco)

    Hi, adding a filter to the plugin would still require modifying the plugin’s source code. If you want a customised version of the plugin ASAP, you can contact me in private (you can find my contact info on https://portfolio3d.francescomartini.it) and let’s find an agreement. Otherwise I’ll try to address the issue in the next plugin’s release, which will probably be in the next few days or weeks (depending on how much time I’ll be able to devote to it).

    Thread Starter lssi2024

    (@lssi2024)

    Thank you, Francesco.

    My colleague Alex Gonzalez will get in touch with you shortly.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.