Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/Admin/Notes
File: WooCommerceSubscriptions.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WooCommerce Admin: WooCommerce Subscriptions.
[2] Fix | Delete
*
[3] Fix | Delete
* Adds a note to learn more about WooCommerce Subscriptions.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
namespace Automattic\WooCommerce\Internal\Admin\Notes;
[7] Fix | Delete
[8] Fix | Delete
defined( 'ABSPATH' ) || exit;
[9] Fix | Delete
[10] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\Note;
[11] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\NoteTraits;
[12] Fix | Delete
use Automattic\WooCommerce\Internal\Admin\Onboarding\OnboardingProfile;
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* WooCommerce_Subscriptions.
[16] Fix | Delete
*/
[17] Fix | Delete
class WooCommerceSubscriptions {
[18] Fix | Delete
/**
[19] Fix | Delete
* Note traits.
[20] Fix | Delete
*/
[21] Fix | Delete
use NoteTraits;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Name of the note for use in the database.
[25] Fix | Delete
*/
[26] Fix | Delete
const NOTE_NAME = 'wc-admin-woocommerce-subscriptions';
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Get the note.
[30] Fix | Delete
*
[31] Fix | Delete
* @return Note|null
[32] Fix | Delete
*/
[33] Fix | Delete
public static function get_note() {
[34] Fix | Delete
$onboarding_data = get_option( OnboardingProfile::DATA_OPTION, array() );
[35] Fix | Delete
[36] Fix | Delete
if ( ! isset( $onboarding_data['product_types'] ) || ! in_array( 'subscriptions', $onboarding_data['product_types'], true ) ) {
[37] Fix | Delete
return;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
if ( ! self::is_wc_admin_active_in_date_range( 'week-1', DAY_IN_SECONDS ) ) {
[41] Fix | Delete
return;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
$note = new Note();
[45] Fix | Delete
$note->set_title( __( 'Do you need more info about WooCommerce Subscriptions?', 'woocommerce' ) );
[46] Fix | Delete
$note->set_content( __( 'WooCommerce Subscriptions allows you to introduce a variety of subscriptions for physical or virtual products and services. Create product-of-the-month clubs, weekly service subscriptions or even yearly software billing packages. Add sign-up fees, offer free trials, or set expiration periods.', 'woocommerce' ) );
[47] Fix | Delete
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
[48] Fix | Delete
$note->set_name( self::NOTE_NAME );
[49] Fix | Delete
$note->set_content_data( (object) array() );
[50] Fix | Delete
$note->set_source( 'woocommerce-admin' );
[51] Fix | Delete
$note->add_action(
[52] Fix | Delete
'learn-more',
[53] Fix | Delete
__( 'Learn More', 'woocommerce' ),
[54] Fix | Delete
'https://woocommerce.com/products/woocommerce-subscriptions/?utm_source=inbox&utm_medium=product',
[55] Fix | Delete
Note::E_WC_ADMIN_NOTE_UNACTIONED,
[56] Fix | Delete
true
[57] Fix | Delete
);
[58] Fix | Delete
return $note;
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function