• Resolved Romik84

    (@romik84)


    Hi there, I’d like to ask if there is a way to disable the attribute values on the list table view in admin but keep the edit link of the values. If we have many values the table is too tall and looks messy. Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Maybe this code will help you to adjust your issue.

    function custom_fix_the_attr_column_issue() {
    	?>
    	<style>
    	body.taxonomy-pa_color table.wp-list-table td.column-name strong a{
    		overflow: hidden;
    		text-overflow: ellipsis;
    		white-space: nowrap;
    		width: 100px;
    		display: inline-block;
    	} 
    	</style>
    	<?php
    }
    add_action( 'admin_footer', 'custom_fix_the_attr_column_issue' );

    Note: Change pa_color to your taxonomy slug in which you have the issue. You can find taxonomy slug in the URL wp-admin/edit-tags.php?taxonomy=pa_color&post_type=product like this.

    You’ll have to add this custom code in your theme’s / chile theme’s functions.php file.

    Thread Starter Romik84

    (@romik84)

    Hi vijay, thanks for help. Isn’t that function only for a specific attribute? I would need it globally for all attributes. The code looks for the edit link also. Not for the values in the table cell.

    You can try this code if you want customization in all products attributes of WooCommerce.

    function custom_fix_the_attr_column_issue() {
    	?>
    	<style>
    	body.post-type-product[class*="taxonomy-pa_"] table.wp-list-table td.column-name .row-title{
    		overflow: hidden;
    		text-overflow: ellipsis;
    		white-space: nowrap;
    		width: 100px;
    		display: inline-block;
    	} 
    	</style>
    	<?php
    }
    add_action( 'admin_footer', 'custom_fix_the_attr_column_issue' );
    Thread Starter Romik84

    (@romik84)

    Thanks for your continuos help but this code didn’t help either :(. any other ideas?

    Sorry, Can’t help more without looking into your code implementation and what page you’re trying to solve.

    I have tested the code and then sent you. it worked fine for me.

    Maybe you’re talking about the wrong page and I am looking on the wrong page.

    Or maybe you didn’t understand the code. given code won’t remove the value/name field it will just truncate the value in 100px width so if you have a long value then it will be hidden with […]

    Hi there,

    It’s been a while since we heard from you, so I’m marking this thread resolved. Hopefully, you’ve been able to resolve this, but if you haven’t, please open up a new topic and we’ll be happy to help out.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hide attribute values in admin list’ is closed to new replies.