protected function variate($slug) { $guided_methods = WSKL_Payment_Gates::get_checkout_methods('iamport'); $payment_gate_names = WSKL_Payment_Gates::get_pay_gates(); // ID $this->id = 'wskl_iamport_' . $slug; // checkout method and description. $this->checkout_method = $slug; $this->checkout_method_description = $guided_methods[$slug]; // $this->checkout_method_description 변수를 사용하므로 뒤에 위치할 것. $this->init_form_fields(); $this->init_settings(); $this->title = $this->get_option('title'); $this->description = $this->get_option('description'); $this->enabled = $this->get_option('enabled'); // 다보리 설정 URL $tab_href = add_query_arg(array('page' => WSKL_MENU_SLUG, 'tab' => 'checkout-payment-gates'), admin_url('admin.php ')); // Method title: 우커머스 > 설정 > 결제 (checkout) 탭에서 확인 $this->method_title = $payment_gate_names['iamport'] . " - {$guided_methods[$slug]}"; // Method description: 우커머스 > 설정 > 결제 (checkout) 탭에서 확인 $this->method_description = __('세부 설정은 ', 'wskl'); $this->method_description .= wskl_html_anchor(__('다보리 > 지불기능'), array('href' => $tab_href), TRUE); $this->method_description .= __(' 메뉴에서 설정하세요', 'wskl'); add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); }
/** * @callback * @filter plugin_action_links_{$plugin} * * @param $links * * @return array */ public function add_settings_link($links) { if (isset($links['0']) && FALSE !== strstr($links[0], 'Settings')) { unset($links[0]); } $dabory_url = add_query_arg('page', WSKL_MENU_SLUG, admin_url('admin.php')); $settings_link = wskl_html_anchor(__('Settings'), array('href' => $dabory_url), TRUE); $links['settings'] = $settings_link; if (wskl_is_option_enabled('enable_dabory_members') && !isset($links['dabory-members'])) { $links['dabory-members'] = wskl_html_anchor(__('다보리 멤버스', 'wskl'), array('href' => wskl_wp_members_url()), TRUE); } if (wskl_is_option_enabled('enable_dabory_sms') && !isset($links['dabory-sms'])) { $links['dabory-sms'] = wskl_html_anchor(__('다보리 SMS', 'wskl'), array('href' => wskl_dabory_sms_url()), TRUE); } return $links; }
/** * 플러그인이 가진 의존성 및 설정 페이지를 출력하는 템플릿 * * @param string $option_name 옵션 이름. Prefixing 하지 않음. * @param string $plugin_name 의존 외부 플러그인의 이름 * @param string $plugin_link 의존 외부 플러그인의 URL * @param string $setting_page_name 우리 플러그인 안에서 설정 텍스트 * @param string $setting_page_when_enabled 우리 플러그인 안에서 설정 URL * * @return string */ function wskl_inform_plugin_dependency($option_name, $plugin_name = '', $plugin_link = '', $setting_page_name = '', $setting_page_when_enabled = '') { $description = ''; if (!empty($plugin_name)) { $description = sprintf(apply_filters('wskl_inform_plugin_dependency', __('※ 이 기능은 %s이 설치, 활성화 되어 있어야 합니다.', 'wskl'), $option_name, $plugin_name, $plugin_link, $setting_page_name, $setting_page_when_enabled), wskl_html_anchor($plugin_name, array('href' => $plugin_link, 'target' => '_blank'), TRUE)) . ' '; } if (wskl_is_option_enabled($option_name) && !empty($setting_page_name)) { $description .= apply_filters('wskl_inform_plugin_dependency_setting_page', wskl_html_anchor($setting_page_name, array('href' => $setting_page_when_enabled), TRUE)) . ' '; } return $description; }