Hide some Columns of Portfolio List - Backend

edited March 2021 in Portfolio

Hi,

I would like to hide some columns on my Porftolio backend, for specific user roles (author). I am NOT talking about the "Screen options" tab on the top.

I managed to do it for certain default WordPress columns (author, date, comments), but I do not manage to find the right name/class that Betheme uses for the portfolio "categories" and "order" columns.

I am using the following code in my custom functions.php file:

if ( current_user_can('author') ) {

add_filter('manage_portfolio_posts_columns', function ( $columns ) 

{

unset($columns['author'], $columns['date'], $columns['comments'], $columns['portfolio_types'], $columns['portfolio_order'] );

return $columns;

} );

}

What should I correct or add to disable the "Categories" and "Oder" columns?

Thanks in advance,

Comments

  • Hello,

    If you would like to modify it for specific user roles, except changing the theme files, you will have to modify the WP files too.

    But I cannot help you with file customization because it is not allowed in reference to the Item Support Policy. http://themeforest.net/page/item_support_policy

    So if you want to modify files and don't know how, you should contact your web developer. Item Policy says:

    Item support does not include services to modify or extend the item beyond the original features, style, and functionality described on the item page. For customization services that will help you tailor the item to your specific requirements, we recommend contacting the author to see if they privately offer paid customization services or checking out the great service providers on Envato Studio

    thanks

  • edited March 2021

    Sorry,

    I just wanted to know the *name* you gave on Betheme to these two Portfolio columns (Categories, Order); I didn't find this documented anywhere, and the ones I find with the browser inspector do not work.

    Code is on my own.

    Have a nice day,

    Miguel

  • Can you explain to me greater what do you mean by "name", please?

    Please, also tell me what part you are exactly modifying because I do not want to misunderstand you.


    Thanks

  • Hi Phil,

    As stated, I would like to remove (hide or disable) the following columns created by Betheme for the Portfolio:

    I could remove other standard Columns of WordPress (author, date, comments), with the code above, but these two from Betheme seem to have a class or name that I cannot find.

    Just in case - I am not talking about the "Screen Options".

    Thanks in advance, Miguel

  • Please, go to Betheme -> functions -> post-types -> class-mfn-post-type-portfolio.php, and search for function add_columns. There you will be able to remove these columns.


    Best regards

  • Thanks Phil,

    That was really helpful, since I ignored that theme file, I did not realized that the extra columns of the portfolio are called $newcolumns

    Kind regards,

  • So did you handle it?

    Is there anything else I could help you with?


    Best regards

Sign In or Register to comment.