WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#31761 closed enhancement (invalid)

register_activation_hook doesn't work for themes on Network Enable action

Reported by: brainstormforce Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Networks and Sites Keywords:
Focuses: multisite Cc:
PR Number:

Description

Hello

In case of plugins, we've register_activation_hook available on the Network Activate action. Screenshot - http://bsf.io/51lx2

However, in case of themes, register_activation_hook doesn't work nor we have any other similar hook available on Network Enable action. Screenshot - http://bsf.io/xwx7w

Use case of register_activation_hook for themes on Network Enable -

We need to add a menu on Network Admin dashboard as the theme is Network Enabled. Hook similar as register_activation_hook could have helped us achieve this.

Please note, the menu needs to be displayed only on Network Admin dashboard and not on the dashboard of individual sites.

Are we missing something? Any help would be greatly appreciated.

Change History (1)

#1 @dd32
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Network Enabled themes are not the same as Network Activated Plugins.
When a Theme is enabled, it's a flag that says "This theme can be used on your site", plugins it's "Enable this plugin over all sites".

As "Enabled" Themes do not actually include any code on the site (even if network activated), there's no ability for them to add such menus.

I'd say that if you need to add a network admin page, that perhaps part of your theme should actually be a plugin.

Marking as invalid; for the simple reason that no code is included, as such no code can run & we can't really change that either.

Note: See TracTickets for help on using tickets.