Merge pull request #32290 from woocommerce/add/primary-arg-back-to-add-action

Add `$primary` param back to add_action method
This commit is contained in:
Chi-Hsuan Huang 2022-03-23 11:22:52 +08:00 committed by GitHub
commit 9d7879b254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 1 deletions

View File

@ -299,7 +299,6 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
'%s',
'%s',
'%s',
'%d',
'%s',
'%s',
'%s',

View File

@ -620,6 +620,7 @@ class Note extends \WC_Data {
* @param string $label Action label (presented as button label).
* @param string $url Action URL, if navigation needed. Optional.
* @param string $status Status to transition parent Note to upon click. Defaults to 'actioned'.
* @param boolean $primary Deprecated since version 3.4.0.
* @param string $actioned_text The label to display after the note has been actioned but before it is dismissed in the UI.
*/
public function add_action(
@ -627,6 +628,7 @@ class Note extends \WC_Data {
$label,
$url = '',
$status = self::E_WC_ADMIN_NOTE_ACTIONED,
$primary = false,
$actioned_text = ''
) {
$name = wc_clean( $name );

View File

@ -51,6 +51,7 @@ class InsightFirstProductAndPayment {
__( 'Yes', 'woocommerce-admin' ),
false,
Note::E_WC_ADMIN_NOTE_ACTIONED,
false,
__( 'Thanks for your feedback', 'woocommerce-admin' )
);
@ -59,6 +60,7 @@ class InsightFirstProductAndPayment {
__( 'No', 'woocommerce-admin' ),
false,
Note::E_WC_ADMIN_NOTE_ACTIONED,
false,
__( 'Thanks for your feedback', 'woocommerce-admin' )
);

View File

@ -54,6 +54,7 @@ class InsightFirstSale {
__( 'Yes', 'woocommerce-admin' ),
false,
Note::E_WC_ADMIN_NOTE_ACTIONED,
false,
__( 'Thanks for your feedback', 'woocommerce-admin' )
);
$note->add_action(
@ -61,6 +62,7 @@ class InsightFirstSale {
__( 'No', 'woocommerce-admin' ),
false,
Note::E_WC_ADMIN_NOTE_ACTIONED,
false,
__( 'Thanks for your feedback', 'woocommerce-admin' )
);