WordPress.org

Ready to get started?Download WordPress

Forums

Codepress Admin Columns
[resolved] Suggestion - Custom fields to have PHP to display value (3 posts)

  1. Geet Jacobs
    Member
    Posted 1 year ago #

    I am not sure if others have need for this, but I make many custom fields for custom post types. Some of these fields are true / false others are custom array's.

    I would love to have a checkbox on a custom field column option which would say something like "Custom display" which would show a text area where you could enter your own PHP to display the meta value in a custom way.

    Example:

    if( 'meta_value' == 1 ) {
    echo 'Yes';
    }else{
    echo 'No';
    };

    if( 'meta_value' == '' ) {
    echo 'No Data';
    }else{
    echo 'meta_value';
    };

    Who knows its a worthy feature to add, but thought I might suggest it.

    Thanks for the great plugin!

    http://wordpress.org/extend/plugins/codepress-admin-columns/

  2. Codepress
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for your suggested feature.

    In the next release ( probably v1.4.5 ) I will be adding some extra filters which would you accomplish the same thing. Only the code needs to go in your themes functions.php.

    I will give an example when it is released.

    - Tobias

  3. Codepress
    Member
    Plugin Author

    Posted 1 year ago #

    You can now do this by using the filter 'cpac_get_column_value_custom_field'.

    Check out the FAQ section for an example.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic