public function page_init() { global $klikbayi_settings, $klikbayi_sanitize; $this->options = $klikbayi_settings; $this->groups = $this->mb_group(); $this->default_setting = klikbayi_default_setting('reset'); $this->url = klikbayi_url('url'); $this->domain = klikbayi_url('domain'); $this->blog = klikbayi_blog(); $this->validate = $klikbayi_sanitize; $this->type = $this->validate->type_array(); $this->style = $this->validate->style_array(); $this->plugin_data = get_plugin_data(KLIKBAYI_PLUGIN_PATH . '/klikbayi.php'); register_setting('option_klikbayi', 'klikbayi_option', array($this, 'sanitize')); foreach ($this->groups as $t => $arr) { add_settings_section('setting_section_' . $t, '', array($this, 'print_section_info_' . $t), 'klikbayi_option_' . $t); add_meta_box('meta-box-' . $t, __($arr[0], 'klikbayi'), array($this, 'box_' . $t), 'klikbayi_option_' . $t, 'normal', 'high'); foreach ($arr[1] as $k => $v) { if ('shortcode' == $k || 'sidebar' == $k) { continue; } add_settings_field($k, __($v, 'klikbayi'), array($this, $k . '_cb'), 'klikbayi_option_' . $t, 'setting_section_' . $t); } } }
function klikbayi_plugin_action_links($actions, $plugin_file) { static $plugin; if (!isset($plugin)) { $plugin = plugin_basename(KLIKBAYI_PLUGIN_FILE); } if ($plugin == $plugin_file) { $settings = array('settings' => '<a href="options-general.php?page=setting-admin-klikbayi">' . __('Settings', 'klikbayi') . '</a>'); $affiliate_link = array('support' => '<a href="' . esc_url(klikbayi_url('url')) . '/affiliasi.php" target="_blank">' . __('Affiliate Login', 'klikbayi') . '</a>'); $actions = array_merge($settings, $actions); $actions = array_merge($affiliate_link, $actions); } return $actions; }
function klikbayi_form_order($button_text, $type, $head = '', $style) { global $klikbayi_sanitize; $url = klikbayi_url('aff'); $html = $head; $html .= sprintf('<form action="%1$s" id="klikbayi" method="post"><table id="klikbayi-%2$s">', esc_url($url), sanitize_html_class($style)); $item = kb_order_array(); foreach ($item as $k => $v) { $input_type = 'email' == $k || 'tel' == $k ? $k : 'text'; $placeholder = 'placeholder' != $style ? '' : $v[0]; $html .= klikbayi_input_order($k, $v[0], $input_type, $placeholder, $v[1], $style); } $html .= '</table>'; $html .= klikbayi_button_order($button_text, $type, 'btn-klikbayi'); $html .= '</form>'; return $html; }
function klikbayi_form_order($button_text, $type, $head = '', $style) { global $klikbayi_sanitize; $url = klikbayi_url('aff'); $html = $head . '<form action="' . esc_url($url) . '" id="klikbayi" method="post"><table id="klikbayi-' . $style . '">'; $item = kb_order_array(); foreach ($item as $k => $v) { $input_type = 'email' == $k ? 'email' : 'text'; $placeholder = 'placeholder' != $style ? '' : $v[0]; $html .= klikbayi_input_order($k, $v[0], $input_type, $placeholder, $v[1], $style); } $html .= '</table>' . klikbayi_button_order($button_text, $type); $html .= '</form>'; return $html; }