Skip to content

7.3.x to 7.4.x Developer Migration Notes

Kowsar Hossain edited this page Oct 4, 2022 · 2 revisions

Summary

Directorist v7.4.0 is solely focused on icon optimization. As a part of the optimization process, we have refactored all the codes related to rendering icons. Previously font-awesome and line-awesome webfonts have been used for generating icons. From this version, these webfonts have been replaced with the respective svg icons. This way, webpage speed will be improved slightly.

This version isn’t fully backward compatible, which means additional work needs to be done to all existing themes and extensions to ensure compatibility.

What happens to the existing themes and extensions?

They will continue to work like before, except the icons will be missing or invisible. That's why compatibility must be added for them to work perfectly.

What's changed?

  1. In the frontend: font-awesome, line-awesome and unicons web-fonts are not enqueued anymore. Previously they were enqueued in all pages.
  2. In the backend: the above web-fonts are enqueued like before, but only on selected admin pages. Previously they were enqueued in all admin pages.
  3. Function directorist_icon() has been modified, now it renders svg icons of font-awesome and line-awesome instead of web-fonts.
  4. Icon style updated.
  5. Icon version updated, now font-awesome v5.15.4 and line-awesome v1.3.0 is used.

Guide to ensure compatibility in themes and extensions

  1. In the frontend, all icons must be rendered using the directorist_icon() function. If any icons were rendered without using this function before, they should be replaced.
  2. Avoid using legacy icon code inside directorist_icon() function, make sure your icon code is compatible with font-awesome v5.15.4 and line-awesome v1.3.0. For example, don't use directorist_icon('fa fa-home'), use directorist_icon('fas fa-home') instead.
  3. In the backend, since web-fonts are still enqueued, no changes are necessary. But if you have any custom admin pages, web-fonts may not be enqueued in those pages. For those pages, you have to enqueue the web-fonts manually.
  4. Since directorist_icon() function now renders different output, icon style will be changed. You may have to update the CSS accordingly to deal with the style changes.

Filters removed

  1. atbdp_single_listing_tags_icon

Functions deprecated

  1. atbdp_icon_type
  2. atbdp_get_term_icon
  3. get_fa_icons
  4. get_fa_icons_full

New functions/methods added

  1. \Directorist\Helper::get_icon_src( $icon )

New localized data added

  1. directorist.assets_url
  2. directorist.icon_markup

Templates updated

  1. templates/all-authors.php
  2. templates/single-reviews.php
  3. templates/account/registration.php
  4. templates/archive/directory-type-nav.php
  5. templates/archive/fields/category.php
  6. templates/archive/fields/google-map.php
  7. templates/archive/fields/openstreet-map.php
  8. templates/archive/fields/posted_date.php
  9. templates/archive/fields/view_count.php
  10. templates/author/about.php
  11. templates/author/header.php
  12. templates/dashboard/listing-row.php
  13. templates/dashboard/navigation.php
  14. templates/dashboard/notice.php
  15. templates/dashboard/restrict-access.php
  16. templates/dashboard/tab-announcement.php
  17. templates/dashboard/tab-fav-listings.php
  18. templates/dashboard/tab-my-listings.php
  19. templates/dashboard/tab-profile.php
  20. templates/listing-form/add-listing-type.php
  21. templates/listing-form/quick-login.php
  22. templates/listing-form/fields/map.php
  23. templates/listing-form/fields/pricing.php
  24. templates/payment/checkout.php
  25. templates/search-form/directory-type-nav.php
  26. templates/search-form/more-buttons.php
  27. templates/search-form/top-cats.php
  28. templates/search-form/fields/location.php
  29. templates/single/section-author_info.php
  30. templates/single/section-related_listings.php
  31. templates/single/top-actions.php
  32. templates/single/fields/category.php
  33. templates/single/fields/location.php
  34. templates/single/fields/ratings_count.php
  35. templates/single/fields/share.php
  36. templates/single/fields/social_info.php
  37. templates/single/fields/tag.php
  38. templates/taxonomies/categories-grid.php
  39. templates/widgets/author-info.php
  40. templates/widgets/featured-listing.php
  41. templates/widgets/login-form.php
  42. templates/widgets/popular-listings.php
  43. templates/widgets/similar-listing.php