Plugin Directory

Codepress Admin Columns

Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.

I have an idea for a great way to improve this plugin

Great! I'd love to hear from you. Leave your feedback at http://www.codepress.nl/plugins/codepress-admin-columns/feedback.

How can I change the thumbnail size of images?

You can use the build in filter to set your own thumbnail size. Just add this piece of code to your theme's functions.php.

To set a custom size use, for example 194 width by 63 height pixels:

<?php

// edit here: fill in your thumbnail height and width
$my_height = 63;
$my_width  = 194;
// stop editing

add_image_size( 'admin-columns', $my_width, $my_height, true );
add_filter('cpac_thumbnail_size', 'cb_cpac_thumbnail_size' );
function cb_cpac_thumbnail_size() {
    return 'admin-columns';
};
?>

my columns thumbnails still have the wrong size

If 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/.

How can I enable the use of Hidden Custom Fields?

I am currently working on settings page where you can enable this feature. In the meanwhile you can enable this by adding this piece of code to your theme's functions.php:

<?php
add_filter('cpac_use_hidden_custom_fields', '__return_true'); // enables the use hidden custom fields
?>

Now you can select your HIDDEN custom fields in de dropdown menu under "Custom Field:".

How can I add the dropdown menu for taxonomy filtering?

This will also be included in the upcoming settings page, in the meanwhile you can enable this by adding this piece of code to your theme's functions.php:

<?php
add_filter( 'cpac-remove-filtering-columns', '__return_false' ); // add dropdown taxonomy filtering to the overview pages
?>

How can I display a custom value in the Custom Fields Column?

With this filter 'cpac_get_column_value_custom_field' you can control what the value will be for any Custom Field Column.

Filter explained:

  • $value is the original value which would otherwise be displayed
  • $internal_field_key is only used internally to store the column
  • $custom_field is the name of your custom field
  • $type will return either the posttype or if it is any other type it will return wp-comments, wp-links, wp-users, wp-media.
  • $object_id will return the ID of the object.

For example if you have a custom posttype 'Demo' with a custom_field that is called 'city' and the result would be an integer '33'. You can change that integer '33' to Amsterdam.

<?php
function my_custom_field_value( $value, $internal_field_key, $custom_field, $type, $object_id )
{
    $my_post_type  = 'demo';
    $my_field_name = 'city';

    // make sure we have the correct posttype and fieldname
    if ( $my_post_type == $type && $my_field_name == $custom_field ) {

        if ( '33' == $value )
            $value = 'Amsterdam';

        elseif ( '34' == $value )
            $value = 'New York';
    }
    return $value;
}
add_filter( 'cpac_get_column_value_custom_field', 'my_custom_field_value', 10, 5 );
?>

Requires: 3.1 or higher
Compatible up to: 3.5.1
Last Updated: 2012-12-14
Downloads: 40,597

Ratings

4 stars
4.9 out of 5 stars

Support

1 of 14 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Works!

11 people say it works.
0 people say it's broken.

67,3,2 50,2,1 100,1,1 100,2,2 100,2,2 100,4,4 100,2,2 100,2,2
100,1,1 100,2,2 100,3,3
92,12,11 100,5,5 100,3,3 100,2,2 100,1,1 100,2,2 100,2,2
100,1,1 100,8,8
100,3,3 100,1,1 100,1,1
100,6,6 100,1,1 100,7,7 100,1,1
100,2,2 92,12,11 0,1,0
100,5,5
100,11,11