get_queried_object_id(); $post_id = dw_get_lang_id($post_id, 'page'); if(defined('ICL_LANGUAGE_CODE')) $show = isset($instance['lang-'. ICL_LANGUAGE_CODE]) ? ($instance['lang-'. ICL_LANGUAGE_CODE]) : false; if (is_home()){ $show = isset($instance['page-home']) ? ($instance['page-home']) : false; }else if (is_front_page()){ $show = isset($instance['page-front']) ? ($instance['page-front']) : false; }else if (is_category()){ $show = isset($instance['cat-'. get_query_var('cat')]) ? ($instance['cat-'. get_query_var('cat')]) : false; }else if(is_tax()){ $term = get_queried_object(); $show = isset($instance['tax-'. $term->taxonomy]) ? ($instance['tax-'. $term->taxonomy]) : false; unset($term); }else if (is_archive()){ $show = isset($instance['page-archive']) ? ($instance['page-archive']) : false; if (!$show) { if(function_exists('get_post_type')){ $type = get_post_type(); $show = isset($instance['type-'. $type.'-archive']) ? ($instance['type-'. $type.'-archive']) : false; } } }else if (is_single()){ if(function_exists('get_post_type')){ $type = get_post_type(); if($type != 'page' and $type != 'post') $show = isset($instance['type-'. $type]) ? ($instance['type-'. $type]) : false; } if(!isset($show)) $show = isset($instance['page-single']) ? ($instance['page-single']) : false; if (!$show){ $cats = get_the_category(); foreach($cats as $cat){ if ($show) continue; $cat_id = dw_get_lang_id($cat->cat_ID, 'category'); if (isset($instance['cat-'. $cat_id])) $show = $instance['cat-'. $cat_id]; } } }else if (is_404()){ $show = isset($instance['page-404']) ? ($instance['page-404']) : false; }else if (is_search()){ $show = isset($instance['page-search']) ? ($instance['page-search']) : false; }else if($post_id){ $show = isset($instance['page-'. $post_id]) ? ($instance['page-'. $post_id]) : false; } if ($post_id and !$show and isset($instance['other_ids']) and !empty($instance['other_ids'])){ $other_ids = explode(',', $instance['other_ids']); foreach($other_ids as $other_id){ if($post_id == (int)$other_id) $show = true; } } if(!isset($show)) $show = false; $instance['dw_include'] = isset($instance['dw_include']) ? $instance['dw_include'] : (isset($instance['include']) ? $instance['include'] : 0); $instance['dw_logout'] = isset($instance['dw_logout']) ? $instance['dw_logout'] : (isset($instance['logout']) ? $instance['logout'] : 0); $instance['dw_login'] = isset($instance['dw_login']) ? $instance['dw_login'] : (isset($instance['login']) ? $instance['login'] : 0); if (($instance['dw_include'] and $show == false) or ($instance['dw_include'] == 0 and $show)){ return false; }else{ global $user_ID; if( (isset($instance['dw_logout']) and $instance['dw_logout'] and $user_ID) or (isset($instance['dw_login']) and $instance['dw_login'] and !$user_ID)) return false; } return $instance; } function dw_show_hide_widget_options($widget, $return, $instance){ dw_register_globals(); global $dw_pages, $dw_cats, $dw_taxes, $dw_cposts, $dw_checked, $dw_loaded, $dw_langs; $wp_page_types = array( 'front' => __('Front', 'display-widgets'), 'home' => __('Blog', 'display-widgets'), 'archive' => __('Archives', 'display-widgets'), 'single' => __('Single Post', 'display-widgets'), '404' => '404', 'search' => __('Search', 'display-widgets') ); $instance['dw_include'] = isset($instance['dw_include']) ? $instance['dw_include'] : (isset($instance['include']) ? $instance['include'] : 0); $instance['dw_logout'] = isset($instance['dw_logout']) ? $instance['dw_logout'] : (isset($instance['logout']) ? $instance['logout'] : 0); $instance['dw_login'] = isset($instance['dw_login']) ? $instance['dw_login'] : (isset($instance['login']) ? $instance['login'] : 0); $instance['other_ids'] = isset($instance['other_ids']) ? $instance['other_ids'] : ''; ?>
id="get_field_id('dw_logout'); ?>" name="get_field_name('dw_logout'); ?>" value="1" />
id="get_field_id('dw_login'); ?>" name="get_field_name('dw_login'); ?>" value="1" />
id="get_field_id('page-'. $key); ?>" name="get_field_name('page-'. $key); ?>" />
ID], true) ?> id="get_field_id('page-'. $page->ID); ?>" name="get_field_name('page-'. $page->ID); ?>" />
id="get_field_id('type-'. $post_key); ?>" name="get_field_name('type-'. $post_key); ?>" />
id="get_field_id('type-'. $post_key.'-archive'); ?>" name="get_field_name('type-'. $post_key.'-archive'); ?>" />
cat_ID], true) ?> id="get_field_id('cat-'. $cat->cat_ID); ?>" name="get_field_name('cat-'. $cat->cat_ID); ?>" />
id="get_field_id('tax-'. $tax); ?>" name="get_field_name('tax-'. $tax); ?>" />
id="get_field_id('lang-'. $key); ?>" name="get_field_name('lang-'. $key); ?>" />