WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
Bug in get_custom_field_meta and get_custom_field_def (2 posts)

  1. GreyhoundXX
    Member
    Posted 1 year ago #

    I've worked my way around this, but just wanted to let you know that get_custom_field_meta() doesn't single out one field, it gets everything for that custom field. It does what get_custom_field_def() is supposed to do, I think.

    On the other hand, get_custom_field_def gives me this error:

    Fatal error: Call to undefined function get_custom_field_def()

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Ah, you're right, thanks for catching that... I've updated the functions file -- my intention was to merge the 2 functions because they are so similar, but I probably got distracted when I was working on that and I neglected to update the wiki. The wiki has been updated now: http://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_custom_field_meta

    So in your includes/functions.php file, the get_custom_field_meta() function should look like this:

    function get_custom_field_meta($fieldname, $item=null) {
    	$data = get_option( CCTM::db_key, array() );
    
    	if (isset($data['custom_field_defs'][$fieldname])) {
    		if ($item && isset($data['custom_field_defs'][$fieldname][$item])) {
    			return $data['custom_field_defs'][$fieldname][$item];
    		}
    		else {
    			return $data['custom_field_defs'][$fieldname]
    		}
    	}
    	else {
    		return sprintf( __('Invalid field name: %s', CCTM_TXTDOMAIN), $fieldname );
    	}
    }

    This fix will be in 0.9.6.1.

    Just a reminder to please file a bugs in the bug tracker: http://code.google.com/p/wordpress-custom-content-type-manager/issues/list

    if they're not in the bug-tracker, then there's no guarantee they'll get fixed, and if they do happen to get fixed, there's no record of them.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic