mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Add the plugin base name
This commit is contained in:
parent
9bf1042a01
commit
c48f3e6d2a
2 changed files with 6 additions and 3 deletions
|
@ -2159,7 +2159,7 @@ return array(
|
|||
},
|
||||
|
||||
'wcgateway.settings.inbox-note-registrar' => static function( ContainerInterface $container ): InboxNoteRegistrar {
|
||||
return new InboxNoteRegistrar( $container->get( 'wcgateway.settings.inbox-notes' ) );
|
||||
return new InboxNoteRegistrar( $container->get( 'wcgateway.settings.inbox-notes' ), $container->get( 'ppcp.plugin' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Settings\WcInboxNotes;
|
|||
|
||||
use Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
use WpOop\WordPress\Plugin\PluginInterface;
|
||||
|
||||
/**
|
||||
* Registers inbox notes in the WooCommerce Admin inbox section.
|
||||
|
@ -19,9 +20,11 @@ class InboxNoteRegistrar {
|
|||
* @var InboxNoteInterface[]
|
||||
*/
|
||||
protected array $inbox_notes;
|
||||
protected PluginInterface $plugin;
|
||||
|
||||
public function __construct( array $inbox_notes ) {
|
||||
public function __construct( array $inbox_notes, PluginInterface $plugin ) {
|
||||
$this->inbox_notes = $inbox_notes;
|
||||
$this->plugin = $plugin;
|
||||
}
|
||||
|
||||
public function register(): void {
|
||||
|
@ -37,7 +40,7 @@ class InboxNoteRegistrar {
|
|||
$note->set_content( $inbox_note->content() );
|
||||
$note->set_type( $inbox_note->type() );
|
||||
$note->set_name( $inbox_note_name );
|
||||
$note->set_source( 'your-plugin-name' );
|
||||
$note->set_source( $this->plugin->getBaseName() );
|
||||
$note->set_status( $inbox_note->status() );
|
||||
|
||||
$inbox_note_action = $inbox_note->action();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue