Plugin Directory

Changeset 601892


Ignore:
Timestamp:
09/21/2012 08:05:49 AM (13 years ago)
Author:
codepress
Message:

1.4.6.4

Location:
codepress-admin-columns
Files:
75 added
6 edited

Legend:

Unmodified
Added
Removed
  • codepress-admin-columns/trunk/classes/sortable.php

    r600963 r601892  
    893893                        $cposts[$p->ID] = $name;
    894894                    }
     895                }
     896                break;
     897               
     898            case 'column-before-moretag' :
     899                $sort_flag = SORT_STRING;
     900                foreach ( $this->get_any_posts_by_posttype($post_type) as $p ) {
     901                    $extended   = get_extended($p->post_content);
     902                    $content    = !empty($extended['extended']) ? $extended['main'] : '';                   
     903                    $cposts[$p->ID] = $this->prepare_sort_string_value($content);
    895904                }
    896905                break;
  • codepress-admin-columns/trunk/classes/utility.php

    r588235 r601892  
    1313{
    1414    global $pagenow;
    15    
     15
    1616    if (
    17         isset($_REQUEST['page']) && 'codepress-admin-columns' == $_REQUEST['page'] &&
    18         'options-general.php' == $pagenow && defined('WPSEO_PATH') &&
     17        isset($_REQUEST['page']) &&
     18        'codepress-admin-columns' == $_REQUEST['page'] &&
     19        'options-general.php' == $pagenow &&
     20        defined('WPSEO_PATH') &&
    1921        file_exists(WPSEO_PATH.'admin/class-metabox.php')
    2022        ) {
  • codepress-admin-columns/trunk/classes/values.php

    r600963 r601892  
    140140            return false;
    141141       
     142        // get thumbnail image size
     143        $image_size = $this->thumbnail_size; // w, h
     144       
     145        // incase the thumbnail dimension is set by name
     146        if ( !is_array($image_size) ) {
     147            global $_wp_additional_image_sizes;
     148            if ( isset($_wp_additional_image_sizes[$image_size]) ) {
     149                $_size      = $_wp_additional_image_sizes[$image_size];
     150                $image_size = array( $_size['width'], $_size['height'] );
     151            }
     152        }
     153       
     154        // fallback for image size incase the passed size name does not exists
     155        if ( !isset($image_size[0]) || !isset($image_size[1]) ) {
     156            $image_size = array(80, 80);
     157        }
     158       
    142159        // get correct image path
    143160        $image_path = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $image);
     
    145162        // resize image     
    146163        if ( file_exists($image_path) && $this->is_image($image_path) ) {
    147             $resized = image_resize( $image_path, 80, 80, true);
    148            
     164            $resized = image_resize( $image_path, $image_size[0], $image_size[1], true);
     165           
     166            // resize worked
    149167            if ( ! is_wp_error( $resized ) ) {
    150168                $image  = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $resized);
    151169               
    152                 return "<img src='{$image}' alt='' width='80' height='80' />";
    153             }
    154            
    155             return $resized->get_error_message();
     170                return "<img src='{$image}' alt='' width='{$image_size[0]}' height='{$image_size[1]}' />";
     171            }
     172           
     173            // resizing failed so let's return full image with maxed dimensions
     174            else {
     175                return "<img src='{$image}' alt='' style='max-width:{$image_size[0]}px;max-height:{$image_size[1]}px' />";             
     176            }           
    156177        }
    157178       
  • codepress-admin-columns/trunk/classes/values/posts.php

    r587696 r601892  
    191191                break;
    192192           
     193            // Before More Tag
     194            case "column-before-moretag" :
     195                $p          = get_post($post_id);
     196                $extended   = get_extended($p->post_content);
     197               
     198                if ( !empty($extended['extended']) ) {
     199                    $result = $this->get_shortened_string($extended['main'], $this->excerpt_length );
     200                }
     201                break;
     202           
    193203            default :
    194204                $result = '';
  • codepress-admin-columns/trunk/codepress-admin-columns.php

    r600963 r601892  
    11<?php
    22/*
     3
    34Plugin Name:        Codepress Admin Columns
    4 Version:            1.4.6.3
     5Version:            1.4.6.4
    56Description:        Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
    67Author:             Codepress
     
    2728*/
    2829
    29 define( 'CPAC_VERSION',     '1.4.6.3' );
     30define( 'CPAC_VERSION',     '1.4.6.4' );
    3031define( 'CPAC_TEXTDOMAIN',  'codepress-admin-columns' );
    3132define( 'CPAC_SLUG',        'codepress-admin-columns' );
     
    966967     */
    967968    private function get_wp_default_posts_columns($post_type = 'post')
    968     {
    969         global $current_screen;
    970        
     969    {       
    971970        // some plugins depend on settings the $_GET['post_type'] variable such as ALL in One SEO
    972971        $_GET['post_type'] = $post_type;
     
    979978        $columns = get_column_headers( 'edit-'.$post_type );
    980979       
    981         // get default columns
    982         if ( empty($columns) && isset($current_screen) ) {     
     980        // get default columns     
     981        if ( empty($columns) ) {       
    983982           
    984983            // deprecated as of wp3.3
     
    998997            // we need to change the current screen
    999998            global $current_screen;
     999           
     1000            // save original
    10001001            $org_current_screen = $current_screen;
    1001                
     1002           
     1003            // prevent php warning
     1004            if ( !isset($current_screen) ) $current_screen = new stdClass;
     1005           
    10021006            // overwrite current_screen global with our post type of choose...
    10031007            $current_screen->post_type = $post_type;
     
    10081012            // reset current screen
    10091013            $current_screen = $org_current_screen;
     1014
    10101015        }
    10111016       
     
    10871092     */
    10881093    private function get_wp_default_media_columns()
    1089     {
    1090         global $current_screen;
    1091        
     1094    {       
    10921095        // @todo could use _get_list_table('WP_Media_List_Table') ?
    10931096        if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
     
    10961099            require_once(ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php');
    10971100       
    1098         if ( !isset($current_screen) )
    1099             return false;
    1100        
     1101        global $current_screen;
     1102
    11011103        // save original
    11021104        $org_current_screen = $current_screen;
     1105       
     1106        // prevent php warning
     1107        if ( !isset($current_screen) ) $current_screen = new stdClass;
    11031108       
    11041109        // overwrite current_screen global with our media id...
     
    11631168     */
    11641169    private function get_wp_default_comments_columns()
    1165     {
    1166         global $current_screen;
    1167        
     1170    {       
    11681171        // dependencies
    11691172        if ( file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php') )
     
    11721175            require_once(ABSPATH . 'wp-admin/includes/class-wp-comments-list-table.php');
    11731176       
    1174         if ( !isset($current_screen) )
    1175             return false;
    1176            
     1177        global $current_screen;
     1178
     1179        // save original       
    11771180        $org_current_screen = $current_screen;
     1181       
     1182        // prevent php warning
     1183        if ( !isset($current_screen) ) $current_screen = new stdClass;
    11781184       
    11791185        // overwrite current_screen global with our media id...
     
    13121318                'label'         => __('Display Author As', CPAC_TEXTDOMAIN),
    13131319                'display_as'    => ''
     1320            ),
     1321            'column-before-moretag' => array(
     1322                'label' => __('Before More Tag', CPAC_TEXTDOMAIN)               
    13141323            )
    13151324        );
     
    20162025    {       
    20172026        global $current_screen;
    2018                
     2027       
    20192028        // we dont need the 'edit-' part
    20202029        $screen = str_replace('edit-', '', $current_screen->id);
  • codepress-admin-columns/trunk/readme.txt

    r600978 r601892  
    44Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
    55Requires at least: 3.1
    6 Tested up to: 3.4
    7 Stable tag: 1.4.6.3
     6Tested up to: 3.4.2
     7Stable tag: 1.4.6.4
    88
    99Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
     
    3737* Last Modified
    3838* Comment count
     39* Before More Tag Content
    3940* Custom Fields
    4041
     
    169170`
    170171
    171 **my already uploaded images have a wrong size**
     172**my columns thumbnails still have the wrong size**
     173
    172174If you want your already uploaded images to display the newly added size you will need to regenerate the thumbnail for them. Use this plugin to generate the newly added sized thumbnails: http://wordpress.org/extend/plugins/regenerate-thumbnails/.
    173175
     
    202204Filter explained:
    203205
    204 * **$value** is the orgignal value which would otherwise be displayed
     206* **$value** is the original value which would otherwise be displayed
    205207* **$internal_field_key** is only used internally to store the column
    206208* **$custom_field** is the name of your custom field
     
    232234`
    233235
    234 
    235236== Screenshots ==
    236237
     
    244245
    245246== Changelog ==
     247
     248= 1.4.6.4 =
     249* Added 'before more tag' column, which will show the content which is placed before the more-tag
     250* bug fix: file images will now also be displayed when they can not be resized.
     251* bug fix: the checkbox disappeared when resetting columns and resaving them.
    246252
    247253= 1.4.6.3 =
Note: See TracChangeset for help on using the changeset viewer.