Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
Products::possibly_add_manual_return_notice_script()
Adds a return to task list notice when completing the manual product task.
Метод класса: Products{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Products = new Products(); $Products->possibly_add_manual_return_notice_script( $hook );
- $hook(строка) (обязательный)
- Page hook.
Код Products::possibly_add_manual_return_notice_script() Products::possibly add manual return notice script WC 9.7.1
public function possibly_add_manual_return_notice_script( $hook ) { global $post; if ( $hook !== 'post.php' || $post->post_type !== 'product' ) { return; } if ( ! $this->is_active() || ! $this->is_complete() ) { return; } WCAdminAssets::register_script( 'wp-admin-scripts', 'onboarding-product-notice', true ); // Clear the active task transient to only show notice once per active session. delete_transient( self::ACTIVE_TASK_TRANSIENT ); }