Skip Navigation

[Resolved] Custom CPT Icon

This thread is resolved. Here is a description of the problem and solution.

Problem:
How can I add a custom icon beyond the limited set offered natively for different CPTs to shop up to the left of the name in the admin menu?

Solution:
I ended up doing it with the third party plugin "Admin Editor Pro" which makes it really easy.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 3 replies, has 2 voices.

Last updated by Mateus Getulio 1 year, 3 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2634083

jww

How can I add a custom icon beyond the limited set offered natively for different CPTs to shop up to the left of the name in the admin menu?

Thanks.

#2634113

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Thank you for contacting our support.

As of now, in order to use custom icons you need to do it with some custom code. Please check this example:

add_filter( 'wpcf_type', 'toolset_add_custom_icon', 10, 2 );
 
function toolset_add_custom_icon( $params, $post_type ) {
 
    // adjust to your needs
    $cpt_slug   = 'toolset-post-type';
 
     
    if( $post_type != $cpt_slug ) {
        return $params;
    }
 
  $params['menu_icon']='any_image_url'; 
 
    return $params;
 
}

Please see some threads where this was done so you can base on to make your own code:

https://toolset.com/forums/topic/unable-to-add-custom-icon-for-custom-post-type/#post-1225119
https://toolset.com/forums/topic/ability-to-add-custom-icon/

Currently, there's no estimate on this feature to be added to the GUI.

Feel free to reply back here if you need further assistance and I'll be happy to help.

Mateus

#2634205

jww

Ok thanks.
I ended up doing it with the third party plugin "Admin Editor Pro" which makes it really easy.

Thanks.

#2634459

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Glad that you were able to resolve this. Thank you for sharing the solution!

I hope we are good to close here =)

Feel free to contact us any time if you need assistance with our products.

Kind regards
Mateus