[Resolved] datepicker icon and delete on views and cred
This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
The default icon for datepicker (which seems to be used on both cred and views) is too small to be useful so I was trying to style it; but its so small at 16px x 15px it needs to be replaced....
I found two tips which gave code similar to this.
function ii_datepicker_delete_icon(){
$calendar_delete_image = "/wp-content/uploads/2019/03/pencil.png";
return $calendar_delete_image;
}
add_filter('wptoolset_filter_wptoolset_delete_date_image', 'ii_datepicker_delete_icon');
function ii_change_datepicker_icon(){
$calendar_image = '/wp-content/uploads/2019/03/calendar-1.png';
return $calendar_image;
}
add_filter('wptoolset_filter_wptoolset_calendar_image', 'ii_change_datepicker_icon');
The Delete function works for Views but not Cred
The Change function works for Cred but not Views
You can override that using custom CSS code and to check which CSS code is applying to different page elements, you can use Google Chrome's inspect element tool, as explained in this guide: hidden link
For example, to control the size of the calendar and the delete/reset images, you can use following code blocks, respectively:
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/
I realise I can override with CSS but the icon is only 16px so it quickly looks terrible.
Understood about the dashicon - thanks but actually I care less about the delete icon and more about the awful calendar icon of 16px which views is using.
Are you saying there is no hook to replace this wretched 16px calendar.gif in Views ? but there is in forms -- that seems more like an oversight than a design decision !
If so please get the gif changed to something better in the views source and I will make a feature request for a hook in views.
>> Are you saying there is no hook to replace this wretched
>> 16px calendar.gif in Views ? but there is in forms -- that
>> seems more like an oversight than a design decision !
- I'm afraid this isn't what I've shared in my last reply or observed on my test website. Sorry if it resulted in confusion and I'd be happy to clarify this further:
--- In my tests, the first code snippet that
--- you've shared ( screenshot: hidden link ), works for:
--- 1. The calendar and the delete/reset icon in the View:
--- Screenshot: hidden link
What I meant was that the code snippet that you shared allowed me to replace both the calendar and the delete/reset icons in Views.
If you're experiencing different results on your website and the "wptoolset_filter_wptoolset_calendar_image" filter is not changing the calendar icon in a view, you're welcome to share temporary admin login details for the website, along with information on where and how the code and the view can be seen.
I've set your next reply as private and please make a complete backup copy of the website, before sharing the access details.
This limitation seems to be coming from the fact that code execution priority earlier than 20 is not possible from there.
( as mentioned in the guide )
Please remove it from the custom code section and include it through the active theme's "functions.php" file and it should work.