function form($instance) { $defaults = array('title' => NULL, 'redirect' => false, 'homepage' => 1, 'frontpage' => false, 'page' => false, 'category' => 1, 'single' => false, 'date' => false, 'tag' => false, 'attachment' => false, 'taxonomy' => false, 'author' => false, 'search' => false, 'not_found' => false, 'not_show_logged_in' => false); $instance = wp_parse_args((array) $instance, $defaults); $title = esc_attr($instance['title']); $redirect = esc_attr($instance['redirect']); $homepage = $instance['homepage']; $frontpage = $instance['frontpage']; $page = $instance['page']; $category = $instance['category']; $single = $instance['single']; $date = $instance['date']; $tag = $instance['tag']; $attachment = $instance['attachment']; $taxonomy = $instance['taxonomy']; $author = $instance['author']; $search = $instance['search']; $not_found = $instance['not_found']; $not_show_logged_in = $instance['not_show_logged_in']; $base_id = 'widget-' . $this->id_base . '-' . $this->number . '-'; $base_name = 'widget-' . $this->id_base . '[' . $this->number . ']'; $options = array(array($base_id . 'homepage', $base_name . '[homepage]', $homepage, __('Homepage', 'custom-login-page')), array($base_id . 'frontpage', $base_name . '[frontpage]', $frontpage, __('Frontpage (e.g. a static page as homepage)', 'custom-login-page')), array($base_id . 'page', $base_name . '[page]', $page, __('"Page" pages', 'custom-login-page')), array($base_id . 'category', $base_name . '[category]', $category, __('Category pages', 'custom-login-page')), array($base_id . 'single', $base_name . '[single]', $single, __('Single post pages', 'custom-login-page')), array($base_id . 'date', $base_name . '[date]', $date, __('Archive pages', 'custom-login-page')), array($base_id . 'tag', $base_name . '[tag]', $tag, __('Tag pages', 'custom-login-page')), array($base_id . 'attachment', $base_name . '[attachment]', $attachment, __('Attachments', 'custom-login-page')), array($base_id . 'taxonomy', $base_name . '[taxonomy]', $taxonomy, __('Custom Taxonomy pages (only available, if having a plugin)', 'custom-login-page')), array($base_id . 'author', $base_name . '[author]', $author, __('Author pages', 'custom-login-page')), array($base_id . 'search', $base_name . '[search]', $search, __('Search Results', 'custom-login-page')), array($base_id . 'not_found', $base_name . '[not_found]', $not_found, __('"Not Found"', 'custom-login-page'))); $checkall = array($base_id . 'checkall', $base_name . '[checkall]', __('Check all', 'custom-login-page')); a5_text_field($base_id . 'title', $base_name . '[title]', $title, __('Title:', 'custom-login-page'), array('space' => true, 'class' => 'widefat')); a5_url_field($base_id . 'redirect', $base_name . '[redirect]', $redirect, __('Redirect:', 'custom-login-page'), array('space' => true, 'class' => 'widefat', 'placeholder' => home_url('/'))); a5_checkbox($base_id . 'not_show_logged_in', $base_name . '[not_show_logged_in]', $not_show_logged_in, __('Don't show widget to logged in users.', 'custom-login-page'), array('space' => true)); a5_checkgroup(false, false, $options, __('Check, where you want to show the widget. By default, it is showing on the homepage and the category pages:', 'custom-login-page'), $checkall); }
function loginform_background_input() { $label = __('Enter a URL', 'custom-login-page'); if (function_exists('wp_enqueue_media')) { self::tag_it(a5_button('upload-loginform', 'loginform', __('Select Image'), false, array('class' => 'button upload-button'), false), 'p', 1, array('id' => 'loginform_upload', 'style' => 'display: none;'), true); self::tag_it('<img src="' . @self::$options['loginform_background'] . '" alt="' . __('Preview') . '" style="max-width: 320px; height: auto;" />', 'p', 1, array('id' => 'loginform_preview', 'style' => 'display: none;'), true); self::tag_it(a5_button('remove-loginform', 'loginform', __('Remove Image'), false, array('class' => 'button remove-button'), false), 'p', 1, array('id' => 'loginform_remove', 'style' => 'display: none;'), true); $label = __('Or enter a URL', 'custom-login-page'); } self::tag_it($label, 'p', false, false, true); a5_url_field('loginform_url', 'clp_options[loginform_background]', @self::$options['loginform_background'], false, array('style' => 'min-width: 350px; max-width: 500px;')); }