最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugin development - How to find where an object first instantiatiation

programmeradmin0浏览0评论

Problem is solved.

I have built a theme options class so i can build as many option pages as i want, an i implement a singleton design pattern to fetch options only once, and i have WPML plugin installed so i am trying to make options multilingual using the available hook wpml_multilingual_options and every thing seems to be saved and also displayed correctly on frontend but unfortunately in the admin it keeps showing the none translated options, so i am guessing that the singleton object is called somehow before the init hook where the wpml_multilingual_options is hooked to. But i can't find where exactly that singleton object is. can i track an object of the same singleton to find out the path of where the first instantiation occurs.

Problem is solved.

I have built a theme options class so i can build as many option pages as i want, an i implement a singleton design pattern to fetch options only once, and i have WPML plugin installed so i am trying to make options multilingual using the available hook wpml_multilingual_options and every thing seems to be saved and also displayed correctly on frontend but unfortunately in the admin it keeps showing the none translated options, so i am guessing that the singleton object is called somehow before the init hook where the wpml_multilingual_options is hooked to. But i can't find where exactly that singleton object is. can i track an object of the same singleton to find out the path of where the first instantiation occurs.

Share Improve this question edited May 27, 2020 at 6:36 Mohamed Omar asked May 27, 2020 at 6:03 Mohamed OmarMohamed Omar 5191 gold badge5 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I have found out how to track the object, by using the debug_print_backtrace() within the constructor, and now my issue has been solved

发布评论

评论列表(0)

  1. 暂无评论