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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.