post_type) && !empty($screen->post_type)) $post_type = $screen->post_type; else { switch($screen->parent_file) { case "upload.php" : $post_type = 'attachment'; break; case "shopp-products" : $post_type = 'shopp_product'; break; default: $post_type = 'post'; } } } $post_type_taxonomies = get_object_taxonomies($post_type); $post_type_taxonomies = apply_filters('atto/interface/post_type_taxonomies', $post_type_taxonomies); //use the first taxonomy if emtpy taxonomy if ($taxonomy == '' || !taxonomy_exists($taxonomy)) { reset($post_type_taxonomies); $taxonomy = current($post_type_taxonomies); } $post_type_data = get_post_type_object($post_type); if (!taxonomy_exists($taxonomy)) $taxonomy = ''; //set as default for auto $order_type = (isset($options['taxonomy_settings'][$taxonomy]['order_type'])) ? $options['taxonomy_settings'][$taxonomy]['order_type'] : 'manual'; $taxonomy_info = get_taxonomy($taxonomy); if (isset($_GET['switch_order_type'])) { $order_type = sanitize_key(filter_var ( $_GET['switch_order_type'], FILTER_SANITIZE_STRING)); //save the new order $options['taxonomy_settings'][$taxonomy]['order_type'] = $order_type; update_option('tto_options', $options); echo '
'; } //check for order type update if (isset($_POST['order_type'])) { $new_order_type = sanitize_key($_POST['order_type']); if ($new_order_type != 'auto' && $new_order_type != 'manual') $new_order_type = ''; if ($new_order_type != '') { echo ''; $order_type = $new_order_type; //save the new order $options['taxonomy_settings'][$taxonomy]['order_type'] = $order_type; //update the orde_by if (isset($_POST['auto_order_by'])) { $new_order_by = sanitize_key($_POST['auto_order_by']); if ($new_order_by != '') $options['taxonomy_settings'][$taxonomy]['auto']['order_by'] = $new_order_by; } //update the orde_by if (isset($_POST['auto_order'])) { $new_order = sanitize_key($_POST['auto_order']); if ($new_order_by != '') $options['taxonomy_settings'][$taxonomy]['auto']['order'] = $new_order; } update_option('tto_options', $options); } } if(isset($taxonomy_info->hierarchical) && $taxonomy_info->hierarchical === TRUE) $is_hierarchical = TRUE; else $is_hierarchical = FALSE; $current_section_parent_file = ''; switch($post_type) { case "post" : $current_section_parent_file = "edit.php"; break; case "attachment" : $current_section_parent_file = "upload.php"; break; } ?>