', 'after_title' => '
', 'labels' => array( 'main' => 'Select the category(s) to display:', 'all' => ' All', 'only' => ' Only:', 'except' => ' All, except:' ), 'rad_butt_name' => 'show_type_potrf', 'checkbox_name' => 'show_portf', 'terms' => array(), 'current_sel' => array(), 'con_class' => '', 'before_element' => '', 'after_element' => '' ); $opts = wp_parse_args( $opts, $defaults ); if( empty($opts['terms']) ) { return; } if( !empty($opts['current_sel']) && is_array($opts['current_sel']) ) { $key = key($opts['current_sel']); if( is_array($opts['current_sel'][$key]) ) { $$key = $opts['current_sel'][$key]; }else { $$key = array( $opts['current_sel'][$key] ); } } ?>' Ascending', 'DESC' => ' Descending' ); $defaults = array( 'before' => '', 'after' => '', 'element_layout' => ' ', 'element_type' => 'radio', 'description' => 'Order selection' ); $options = apply_filters( 'dt_admin_page_option_order-options', $defaults ); switch( $options['element_type'] ) { case 'select': $e_function = 'selected'; break; default: $e_function = 'checked'; } $options['before'] = sprintf( $options['before'], esc_attr($box_name), $options['description'] ); $options['after'] = sprintf( $options['after'], esc_attr($box_name), $options['description'] ); $elements = ''; foreach( $p_order as $order=>$title ) { $elements .= sprintf( $options['element_layout'], esc_attr($box_name), esc_attr($order), $e_function( $current, $order, false ), $title ); } return $options['before'] . $elements . $options['after']; } // orderby function dt_admin_page_option_orderby( $box_name, $current = false, $white_list = array() ) { if( empty($box_name) ) { return false; } $p_orderby = array( 'date' => __( 'Order by date', LANGUAGE_ZONE ), 'ID' => __( 'Order by ID', LANGUAGE_ZONE ), 'author' => __( 'Order by author', LANGUAGE_ZONE ), 'name' => __( 'Order by name', LANGUAGE_ZONE ), 'title' => __( 'Order by title', LANGUAGE_ZONE ), 'modified' => __( 'Order by modified', LANGUAGE_ZONE ), 'rand' => __( 'Order by rand', LANGUAGE_ZONE ), 'menu_order' => __( 'Order by menu', LANGUAGE_ZONE ), 'parent menu_order' => __( 'Order by parent', LANGUAGE_ZONE ), ); if ( !empty($white_list) ) { foreach ( array_diff( array_keys($p_orderby), $white_list ) as $key ) { unset($p_orderby[ $key ]); } } $defaults = array( 'before' => '%2$s', 'element_layout' => '', 'element_type' => 'select', 'description' => '' ); $options = apply_filters( 'dt_admin_page_option_orderby-options', $defaults ); switch( $options['element_type'] ) { case 'select': $e_function = 'selected'; break; default: $e_function = 'checked'; } $options['before'] = sprintf( $options['before'], esc_attr($box_name), $options['description'] ); $options['after'] = sprintf( $options['after'], esc_attr($box_name), $options['description'] ); $elements = ''; foreach( $p_orderby as $order=>$title ) { $elements .= sprintf( $options['element_layout'], esc_attr($box_name), esc_attr($order), $e_function( $current, $order, false ), $title ); } return $options['before'] . $elements . $options['after']; } // ppp function dt_admin_page_option_ppp( $box_name, $current = false ) { if( empty($box_name) ) { return false; } $data = array( $current ); $defaults = array( 'before' => '', 'element_layout' => '', 'element_type' => 'text', 'description' => 'Number of posts on this page ( if empty - uses standard setting )' ); $options = apply_filters( 'dt_admin_page_option_ppp-options', $defaults ); switch( $options['element_type'] ) { case 'select': $e_function = 'selected'; break; default: $e_function = 'checked'; } $options['before'] = sprintf( $options['before'], esc_attr($box_name), $options['description'] ); $options['after'] = sprintf( $options['after'], esc_attr($box_name), $options['description'] ); $elements = ''; foreach( $data as $value=>$title ) { $elements .= sprintf( $options['element_layout'], esc_attr($box_name), esc_attr($value), $e_function( $current, $value, false ), $title ); } return $options['before'] . $elements . $options['after']; }