Skip to content

Commit

Permalink
Delay registering some services (#13913)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Jan 9, 2025
1 parent 6fe2d57 commit 24e127f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 13 additions & 3 deletions includes/Register_Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@

namespace Google\Web_Stories;

use Google\Web_Stories\Infrastructure\Registerable;
use Google\Web_Stories\Infrastructure\Service;
use Google\Web_Stories\Widgets\Stories;

/**
* Class RegisterWidget
*/
class Register_Widget implements Service, Registerable {
class Register_Widget extends Service_Base {
/**
* Stories instance.
*
Expand Down Expand Up @@ -117,4 +115,16 @@ public function body_class( $classes ) {

return $classes;
}

/**
* Get the action priority to use for registering the service.
*
* @since 1.38.1
*
* @return int Registration action priority to use.
*/
public static function get_registration_action_priority(): int {
// Because wp_widgets_init() runs on priority 1.
return 0;
}
}
4 changes: 1 addition & 3 deletions includes/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@
namespace Google\Web_Stories;

use Google\Web_Stories\Infrastructure\PluginUninstallAware;
use Google\Web_Stories\Infrastructure\Registerable;
use Google\Web_Stories\Infrastructure\Service;
use Google\Web_Stories\Shopping\Shopping_Vendors;

/**
* Settings class.
*/
class Settings implements Service, Registerable, PluginUninstallAware {
class Settings extends Service_Base implements PluginUninstallAware {
/**
* Settings group.
*/
Expand Down

0 comments on commit 24e127f

Please sign in to comment.