Skip to content
Permalink
Browse files

Fixed a bug in model naming

  • Loading branch information...
Nomafin committed Jun 5, 2019
1 parent fb05b22 commit 4f4e3a8213ed12fe4c1200b707e5c6d6d5ecb6ef
Showing with 14 additions and 3 deletions.
  1. +4 −1 CHANGELOG.md
  2. +10 −2 dustpress.php
@@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.23.2] - 2019-06-05

### Fixed
- A bug in how class names with multiple word spaces should be formed.

## [1.23.1] - 2019-06-04

@@ -6,7 +6,7 @@
Author: Miika Arponen & Ville Siltala / Geniem Oy
Author URI: http://www.geniem.com
License: GPLv3
Version: 1.23.1
Version: 1.23.2
*/
final class DustPress {
@@ -297,7 +297,6 @@ public function get_custom_route() {
*
* @return string
*/
private function get_template_filename( &$debugs = array() ) {
global $post;
@@ -342,7 +341,9 @@ private function get_template_filename( &$debugs = array() ) {
if ( is_page() ) {
$hierarchy[ 'is_page' ] = [
'Page' . $this->dashed_to_camelcase( $template, '_' ),
'Page' . $this->dashed_to_camelcase( $template ),
'Page' . $this->dashed_to_camelcase( $post->post_name, '_' ),
'Page' . $this->dashed_to_camelcase( $post->post_name ),
'Page' . $post->ID,
'Page'
@@ -353,6 +354,7 @@ private function get_template_filename( &$debugs = array() ) {
$cat = get_category( get_query_var( 'cat' ) );
$hierarchy[ 'is_category' ] = [
'Category' . $this->dashed_to_camelcase( $cat->slug, '_' ),
'Category' . $this->dashed_to_camelcase( $cat->slug ),
'Category' . $cat->term_id,
'Category',
@@ -365,6 +367,7 @@ private function get_template_filename( &$debugs = array() ) {
$term = get_term_by( 'id', $term_id, 'post_tag' );
$hierarchy[ 'is_tag' ] = [
'Tag' . $this->dashed_to_camelcase( $term->slug. '_' ),
'Tag' . $this->dashed_to_camelcase( $term->slug ),
'Tag',
'Archive'
@@ -376,7 +379,9 @@ private function get_template_filename( &$debugs = array() ) {
$term = get_term_by( 'id', $term_id, get_query_var( 'taxonomy' ) );
$hierarchy[ 'is_tax' ] = [
'Taxonomy' . $this->dashed_to_camelcase( get_query_var( 'taxonomy' ), '_' ) . $this->dashed_to_camelcase( $term->slug ),
'Taxonomy' . $this->dashed_to_camelcase( get_query_var( 'taxonomy' ) ) . $this->dashed_to_camelcase( $term->slug ),
'Taxonomy' . $this->dashed_to_camelcase( get_query_var( 'taxonomy' ), '_' ),
'Taxonomy' . $this->dashed_to_camelcase( get_query_var( 'taxonomy' ) ),
'Taxonomy',
'Archive'
@@ -387,6 +392,7 @@ private function get_template_filename( &$debugs = array() ) {
$author = get_user_by( 'slug', get_query_var( 'author_name' ) );
$hierarchy[ 'is_author' ] = [
'Author' . $this->dashed_to_camelcase( $author->user_nicename, '_' ),
'Author' . $this->dashed_to_camelcase( $author->user_nicename ),
'Author' . $author->ID,
'Author',
@@ -460,7 +466,9 @@ function() use ( $mime_type ) {
$type = get_post_type();
$hierarchy[ 'is_single' ] = [
'Single' . $this->dashed_to_camelcase( $template, '_' ),
'Single' . $this->dashed_to_camelcase( $template ),
'Single' . $this->dashed_to_camelcase( $type, '_' ),
'Single' . $this->dashed_to_camelcase( $type ),
'Single'
];

0 comments on commit 4f4e3a8

Please sign in to comment.
You can’t perform that action at this time.