I am trying to:
Use my own graphic for the dashboard menu icon of my custom post types.
Link to a page where the issue can be seen:
Not really anywhere to see this at present.
I expected to see:
Menu icon changed to my graphic.
Instead, I got:
Nothing.
I have been trying to change my menu icons, and I know there is a feature request out on this one but having a simple upload field next to the icon button should definitely be implemented.
I have read through the documentation, and it references the visibility field of a CPT, but this is no longer a feature and something that is confusing a lot of people. The current build of Types still references this as well in the help drop down at the top of the screen. Given this, most of the information in the forums is sadly useless.
I have found this thread:
https://toolset.com/forums/topic/ability-to-add-custom-icon/#post-586204
Where code is supplied that seems to make perfect sense. I have modified and implemented it, and apparently it runs without issue, but nothing is changing. My CPT slug is "gift-list" and here is my code:
<?php
/**
* Change Gift List Icon
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
add_filter( 'wpcf_type', 'toolset_add_custom_icon', 10, 2 );
function toolset_add_custom_icon( $params, $post_type ) {
// adjust to your needs
$cpt_slug = 'gift-list';
if( $post_type != $cpt_slug ) {
return $params;
}
$params['menu_icon']=theme_url( "../images/fw-dashboard-logo.png", __FILE__ );
return $params;
}
?>
I've added this code in a Toolset custom code snippet and even though I've tried various approaches including simply putting a full url in the $params, but nothing makes any difference. The image file is 16x16 transparent backed png and is stored in the themes image folder.
I may well be missing something obvious, but for the life of me I can't see what and this just feels like it should not be this difficult. I'd really appreciate some help here as I'm going round in circles.
Cheers.