diff --git a/lib/admin-customization.php b/lib/admin-customization.php index 6d165ba..fac5a6a 100644 --- a/lib/admin-customization.php +++ b/lib/admin-customization.php @@ -4,7 +4,7 @@ function method_admin_scripts() { $wp_scripts = wp_scripts(); wp_enqueue_script( 'jquery-ui-dialog' ); wp_enqueue_style( 'jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.css', '', '', false ); - wp_enqueue_style( 'method', get_template_directory_uri() . '/assets/css/admin-styles.css', '', '1.4.3' ); + wp_enqueue_style( 'method', get_template_directory_uri() . '/assets/css/admin-styles.css', '', '1.4.4-prerelease' ); } add_action( 'admin_enqueue_scripts', 'method_admin_scripts' ); diff --git a/lib/helper-functions.php b/lib/helper-functions.php index 597f1da..4dc2ee7 100644 --- a/lib/helper-functions.php +++ b/lib/helper-functions.php @@ -9,7 +9,7 @@ // Get common CSS classes //----------------------------------------------------- -function method_get_class( $class ) { +function method_get_class( $class, $echo = false ) { $output = ''; if ( ! empty( $class ) ) { @@ -25,7 +25,11 @@ function method_get_class( $class ) { } } - return $output; + if ( $echo ) { + echo $output; + } else { + return $output; + } } @@ -110,7 +114,7 @@ function array_key_first( array $arr ) { // Get an array of post IDs and titles //----------------------------------------------------- -function method_get_post_array( $type, $none = '' ) { +function method_get_post_array( $type, $none = '', $labels = false ) { //lets create an array of boroughs to loop through if ( ! empty( $none ) ) { $output[0] = $none; @@ -118,13 +122,27 @@ function method_get_post_array( $type, $none = '' ) { $output = array(); } + $args = array( + 'post_type' => $type, + 'post_status' => 'publish', + 'posts_per_page' => -1, + 'orderby' => 'title', + 'order' => 'ASC' + ); + //The Query - $items = get_posts( 'post_type=' . $type . '&post_status=publish&posts_per_page=-1' ); + $items = get_posts( $args ); if ( $items ) { foreach ( $items as $post ) : setup_postdata( $post ); - $output[ "{$post->ID}" ] = get_the_title( $post->ID ); + $ptl = ''; + if ( $labels ) { + global $wp_post_types; + $lbs = $wp_post_types[$post->post_type]->labels; + $ptl = ' (' . $lbs->singular_name . ')'; + } + $output[ "{$post->ID}" ] = get_the_title( $post->ID ) . $ptl; endforeach; wp_reset_postdata(); } diff --git a/lib/theme-setup.php b/lib/theme-setup.php index 1a4abce..45b4ece 100644 --- a/lib/theme-setup.php +++ b/lib/theme-setup.php @@ -49,8 +49,8 @@ function method_register_custom_nav_menus() { //----------------------------------------------------- function method_scripts() { - wp_enqueue_style( 'method', get_template_directory_uri() . '/theme.min.css', '', '1.4.3' ); - wp_enqueue_script( 'method', get_template_directory_uri() . '/assets/js/scripts.min.js', array( 'jquery' ), '1.4.3', false ); + wp_enqueue_style( 'method', get_template_directory_uri() . '/theme.min.css', '', '1.4.4-prerelease' ); + wp_enqueue_script( 'method', get_template_directory_uri() . '/assets/js/scripts.min.js', array( 'jquery' ), '1.4.4-prerelease', false ); } diff --git a/package.json b/package.json index 7cb31b3..05ffb73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "method", - "version": "1.4.3", + "version": "1.4.4-prerelease", "description": "A barebones foundation for custom theme development.", "main": "index.js", "scripts": { diff --git a/style.css b/style.css index 2e3f330..6722629 100644 --- a/style.css +++ b/style.css @@ -2,7 +2,7 @@ Theme Name: Method Theme URI: https://github.com/pixelwatt/method Description: A barebones foundation for custom theme development. -Version: 1.4.3 +Version: 1.4.4-prerelease License: GNU General Public License v2 or later, Author: Rob Clark Author URI: https://robclark.io/