Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use WP function inside CI Controller or CI View #10

Open
hakimny opened this issue May 6, 2015 · 4 comments
Open

How to use WP function inside CI Controller or CI View #10

hakimny opened this issue May 6, 2015 · 4 comments

Comments

@hakimny
Copy link

hakimny commented May 6, 2015

Hi Dan

Is there a way to use wp functions inside inside CI Controller or CI View.

Thx
Hakim

@dynamodan
Copy link
Owner

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.

@hakimny
Copy link
Author

hakimny commented May 7, 2015

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

@dynamodan
Copy link
Owner

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.

@hakimny
Copy link
Author

hakimny commented May 7, 2015

Thx Dan I was able to see what is available when Wrodpress loads by running var_dump(get_defined_functions());
thx
Hakim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants