WordPress.org

Plugin Directory

Changeset 1523580


Ignore:
Timestamp:
10/28/16 06:18:15 (8 months ago)
Author:
iambriansreed
Message:
  • Fixes At a Glance dashboard issues
Location:
advanced-custom-post-types/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • advanced-custom-post-types/trunk/acpt.php

    r1523578 r1523580  
    33Plugin Name: Advanced Custom Post Types 
    44Description: Customise WordPress with custom post types 
    5 Version: 0.4.0 
     5Version: 0.4.5 
    66Author: iambriansreed 
    77Author URI: http://iambrian.com/ 
  • advanced-custom-post-types/trunk/admin/class-load.php

    r1523578 r1523580  
    33namespace Advanced_Custom_Post_Types\Admin { 
    44 
     5    use Advanced_Custom_Post_Types\Debug; 
    56    use Advanced_Custom_Post_Types\Load_Main; 
    67    use Advanced_Custom_Post_Types\Load_Base; 
     
    109110                    { 
    110111                ?> 
    111                 #dashboard_right_now .<?php echo $post_type['post_type'] ;?>-count a:before { 
    112                     content: "\f<?php echo $post_type['dashicon_unicode_number']; ?>"; 
     112                #dashboard_right_now .<?php echo $post_type['post_type']; ?>-count a:before { 
     113                    content: "\f<?php echo $post_type['args']['dashicon_unicode_number']; ?>"; 
    113114                } 
    114115 
     
    297298        public function dashboard_glance_items( $items ) { 
    298299 
    299             foreach ( $this->loader->get_post_types() as $post_type ) { 
    300  
    301                 if ( $post_type['args']['public'] ) { 
    302  
    303                     $type = $post_type['post_type']; 
    304  
    305                     $num_posts = wp_count_posts( $type ); 
     300            foreach ( $this->loader->get_post_types() as $post_data ) { 
     301 
     302                if ( $post_data['args']['public'] ) { 
     303 
     304                    $num_posts = wp_count_posts( $post_data['post_type'] ); 
    306305 
    307306                    $published = intval( $num_posts->publish ); 
    308307 
    309                     $post_type = get_post_type_object( $type ); 
    310  
    311                     $text = _n( '%s ' . $post_type->args->labels->singular_name, '%s ' . $post_type->args->labels->name, $published ); 
     308                    $text = _n( '%s ' . $post_data['args']['singular_name'], '%s ' . 
     309                                                                             $post_data['args']['plural_name'], $published ); 
    312310 
    313311                    $text = sprintf( $text, number_format_i18n( $published ) ); 
    314312 
    315                     if ( current_user_can( $post_type->args->cap->edit_posts ) ) { 
    316  
    317                         echo '<li class="post-count ' . $post_type->args->labels->name . '-count">' . '<a href="edit.php?post_type=' . $post_type->name . '">' . $text . '</a>' . '</li>'; 
    318                     } else { 
    319                         echo '<li class="post-count ' . $post_type->args->labels->name . '-count">' . '<span>' . $text . '</span>' . '</li>'; 
     313                    $can_view = current_user_can( $this->settings->get( 'capability' ) ); 
     314 
     315                    echo '<li class="post-count ' . $post_data['post_type'] . '-count">'; 
     316 
     317                    if ( $can_view ) { 
     318                        echo '<a href="edit.php?post_type=' . $post_data['post_type'] . '">'; 
    320319                    } 
     320 
     321                    echo $text; 
     322 
     323                    if ( $can_view ) { 
     324                        echo '</a>'; 
     325                    } 
     326 
     327                    echo '</li>'; 
    321328                } 
    322329 
  • advanced-custom-post-types/trunk/admin/class-post-type.php

    r1523578 r1523580  
    5151            Notices::add( implode( '<br>', $this->errors ), 'error', false ); 
    5252        } 
     53 
     54        flush_rewrite_rules(); 
    5355    } 
    5456 
     
    238240 
    239241        $args['menu_icon'] = $dashicon->class_name; 
     242 
     243        $args['dashicon_unicode_number'] = $dashicon->unicode_number; 
    240244 
    241245        return $args; 
  • advanced-custom-post-types/trunk/readme.txt

    r1523578 r1523580  
    6363 
    6464= 0.4.0 = 
    65 * Fixes post name issues more refactoring and cleanup 
    66   
     65* Fixes post name issues more refactoring and cleanup, added title placeholder 
     66 
     67= 0.4.5 = 
     68* Fixes At a Glance dashboard issues 
Note: See TracChangeset for help on using the changeset viewer.