• Resolved Archie22is

    (@archie22is)


    Hi guys,

    I want to return a checkbox value in a column layout. I am currently able to return normal fields using the function below:

    add_action('manage_posts_custom_column', 'my_show_columns');
    function my_show_columns($name) {
    	global $post;
    	switch ($name) {
    
    		case 'telephone':
    			//echo "telephone";
    			$telephone_number = get_post_meta($post->ID, 'telephone_number', true);
    			echo $telephone_number;
    			break;
    
    		case 'email_address':
    			$email_address = get_post_meta($post->ID, 'email_address', true);
    			echo '<a href="mailto:' . $email_address . '">' . $email_address . '</a>';
    			break;		
    
    		case 'featured':
    			$featured = get_post_meta($post->ID, 'featured', true);
    			echo $featured; // returns nothing
    			break;
    	}
    }

    The featured field in this case is a radio button value (Yes/No) taken care of by a custom post type (using the Pods Framework). I wish to return either value that is selected / checked. How will I go about doing that?

    Thank you in advance

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Return checkbox value in column’ is closed to new replies.