Is there a way to prevent a function/method from being called outside a specific hook?

There’s a WordPress function current_filter() that retrieves the name of the current filter or hook that called a function/method. You can match it to a whitelist and either end or continue the function based on the result.

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduedusedueduseduseduseduedusedus