wordpressigniter
wordpressigniter copied to clipboard
How to use WP function inside CI Controller or CI View
Hi Dan
Is there a way to use wp functions inside inside CI Controller or CI View.
Thx Hakim
Some of them, yes. Not all the wordpress functions are instantiated when CodeIgniter runs. There's a document titled "Make sense of WP core load" (google it) that you should study. It's important to know when in WordPress' execution that CodeIgniter runs through its loop. I can't say exactly which ones run.
Do you have an example on how to run WP_Query() , I would like to run it on some CI Views
thx for any help you can provide.
thx Hakim
I don't have an example. When in CodeIgniter, I tend to use CodeIgniter's active record facilities. The reason that I developed this plugin was to integrate a lot of existing code, models, libraries and such that are specifically intended for CodeIgniter, and serve them up within a WordPress context. I'm sorry that there's not more readily available WordPress parts within the CodeIgniter context.
Thx Dan I was able to see what is available when Wrodpress loads by running var_dump(get_defined_functions()); thx Hakim