Notifications
Clear all

wpdiscuz_init not triggered

1 Posts
1 Users
0 Reactions
8 Views
Posts: 1
Topic starter
(@jorre)
New Member
Joined: 1 day ago

For a client we installed the addon wpDiscuz Subscription Manager, but when we want to use it the wp-admin/admin.php?page=wpdiscuz-subscribe didn't work, I got a message: "Sorry you are not allowed to see this page".

With some help of cursor we figured out that the wpdiscuz_inint action is not used anymore in wpDiscuz.

Why wpdiscuz_init is not triggered

The problem:

  • The wpdiscuz_init action was removed or is no longer triggered in wpDiscuz 7.6.26.
  • The Subscribe Manager plugin (version 7.0.9) still uses this old hook.
  • This is a compatibility issue between an older addon and a newer core version.
The solution:
The plugin now initializes at multiple points:

  1. On the init hook (priority 90) — after wpDiscuz loads
  1. On the wpdiscuz_init_options hook — if wpDiscuz triggers it
  1. On the admin_menu hook (priority 0) — as a fallback
A check was added to prevent double initialization.
What to do:

  1. Refresh the WordPress admin page
  1. Test the pagewp-admin/admin.php?page=wpdiscuz-subscribe
  1. If it still doesn't work, try:
  • Deactivating and reactivating the plugin
  • Clearing cache (if applicable)
  • Checking if wpDiscuz is active
Recommendation for the future:
Consider updating the Subscribe Manager plugin to a version compatible with wpDiscuz 7.6.x, if available. This fix should work, but an official update is better for long-term support.
Possible fix:

public function __construct() {
    add_action("init", [&$this, "pluginTextDomain"], 85);
    add_action("admin_notices", [&$this, "wpdsRequirements"], 85);
    // Initialize when wpDiscuz is available
    // Try multiple hooks since wpdiscuz_init was removed in newer wpDiscuz versions
    add_action("init", [&$this, "wpdiscuz_init"], 90);                    // ✅ After wpDiscuz loads
    add_action("wpdiscuz_init_options", [&$this, "wpdiscuz_init"], 85);   // ✅ If wpDiscuz triggers this
    // Also check on admin_menu in case wpDiscuz loads late
    add_action("admin_menu", [&$this, "wpdiscuz_init"], 0);               // ✅ Fallback
}

public function wpdiscuz_init() {
    // Prevent multiple initializations
    if (isset($this->db) && $this->db instanceof wpdSubscribersDBManager) {
        return;
    }
    
    if (function_exists("wpDiscuz")) {
        $this->apimanager = new GVT_API_Manager(__FILE__, "wpdiscuz_options_page", "wpdiscuz_option_page");
        $this->db         = new wpdSubscribersDBManager();
        // Register admin menu - use high priority to ensure it runs after wpDiscuz menu is created
        add_action("admin_menu", [&$this, "addSubscriptionsToAdminMenu"], 876);
        // ... rest of initialization code ...
    }
}
For me this works. But maybe you should look to whats the best solution.
We don't like to have a local version with alterations. Would be nice if this gets fixed.

Share:
Scroll to top