Heliosurge
(Dan DeMontmorency)
06.Июль.2025 07:14:59
8
Этот #theme-component , скорее всего, можно использовать в качестве примера для создания собственного компонента, скрывающего опции «Молчать». Он скрывает лайки для новых пользователей.
This is a very simple theme component that gives you the ability to hide the “like” functionality from new (TL0) users. While not 100% foolproof against an extremely determined troll, it will prevent the “like” elements from ever loading into the DOM while active. The hope is that it can act as an additional obstacle to trolls attempting to abuse likes. I also included the option to hide likes from anons in case that’s helpful for any community.
Before:
[before]
After:
[after]
Installati…
В этом примере используется JavaScript, но я почти уверен, что можно обойтись чистым CSS.
Вот кнопка «Скрыть лайк» на CSS:
You can hide the like button with CSS, but that won’t prevent users from liking posts (a plugin would be required to ensure that), if they figure out how to un-hide the button for example.
I suppose the easiest way would be using CSS Classes for Current User's Groups which adds the current user groups to the body classes, then use CSS such as:
body.category-your-category-slug:not(.group-group_name) {
button.like {
display: none;
}
}
Let me know if you have trouble understandi…
1 лайк