html_elements_ids = $html_elements_ids; $this->info_id = $info_id; $this->phrases_in = $phrases_in; $this->info_html = $info_html; $this->phrases_not_in = $phrases_not_in; } /** * Hooks. */ public function hooks() { add_action( 'admin_footer', array( $this, 'add_contextual_info_script' ) ); } /** * Add contextual info script. */ public function add_contextual_info_script() { $current_screen = get_current_screen(); if ( 'shop_order' === $current_screen->post_type || 'woocommerce_page_wc-settings' === $current_screen->id ) { $html_elements_ids = '#' . implode( ',#', explode( ',', $this->html_elements_ids ) ); $info_id = $this->info_id; $phrases_in = $this->phrases_in; $info_html = $this->info_html; $phrases_not_in = $this->phrases_not_in; include __DIR__ . '/views/contextual-info-script.php'; } } }