Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Thomas

"0" not displayed

Hi,

I noticed that “0” isn’t displayed in the column fields after adding/editing. It seems to be correctly added to the custom fields on single posts though.

Cheers,
Thomas

10 years ago
Jesper

Hi Thomas,

We’ve chosen not to display fields with “0” as their content, as in most contexts, it means “empty”. Using the filter cac/column/value, you can manually alter the column value, allowing you to actually output the “0” if you which.

Best,
Jesper

9 years, 11 months ago
Thomas

OK, thanks. I tried this but it doesn’t seem to work though:

function my_change_column_featured_image_value( $value, $object_id, $column, $storage_key ) {
	if ( $value == '0') {
		$value = '0';
	}
	return $value;
}
add_filter( 'cac/column/value', 'my_change_column_featured_image_value', 10, 4 );

Cheers,
Thomas

9 years, 11 months ago

You must be logged in to reply to this topic.