• Resolved Sayan Datta

    (@infosatech)


    Hello,

    Is there any way to call the Plugin’s Sharing function from another plugin of theme directly?

    GMB is not working if I use this:

    $post = get_post( $post_id );
    if ( class_exists( 'Rop' ) && class_exists( 'Rop_Admin' ) ) {
        $plugin = new \Rop();
        $plugin_admin = new \Rop_Admin( $plugin->get_plugin_name(), $plugin->get_version() );
        $plugin_admin->share_scheduled_future_post( $post );
    }

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Contributor Uriahs Victor

    (@uriahs-victor)

    I’ve not tried this but it should work as long as you meet the method’s requirements, so turn on WP debugging and add some steps to the code to see where the process might be halting.

    Also, share_scheduled_future_post still has to call rop_cron_job_publish_now so that might be the better method to look at if you want to share a post immediately/externally. Log the contents of the $accounts_data parameter for that method to see how the structure looks when you’re using the “Share post instantly using Revive Old Posts” checkbox from the editor screen.

    Then try calling that method from your external theme/plugin with the appropriate params.

    One last thing. GMB is a Pro feature, you need the pro plugin for it to work. This forum is only for the free plugin so unfortunately we can’t help any further with custom coding support

Viewing 1 replies (of 1 total)
  • The topic ‘Call share Function Externally’ is closed to new replies.