admin管理员组

文章数量:1336208

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

本文标签: plugin developmentHow to find where an object first instantiatiation