Welcome Guest, Not a member yet? Register   Sign In
Getting CI instance in Wordpress functions.php
#1

Hi guys,
I have an old project that contains:
a. A CI Folder with project and views inside of it
b. A Wordpress project that contains the CI views as iframes. My job is to take it from the old WP site to Elementor and stuff.

The CI also manages my user authentication and details.

What I'm trying to do on my WP project is:
Changing a button text based on whether the user is logged on or not.
It worked perfectly in the old version using this code:
/* @var $CI \MY_Controller */
$CI =& get_instance();
if ($CI->user->isMember()): etc....


Now I'm trying to create an Elementor Dynamic tag for that inside functions.php
I'm using the same code but I get:  Uncaught Error: Call to undefined function get_instance() 

Not sure what I'm missing but it seems like the WP is not connected to the CI or something and I can't find the point it's connected on the old project.

Thanks a lot guys for your help!
Reply
#2

Adding a pastebin:
https://pastebin.com/5M65EUCm
Reply




Theme © iAndrew 2016 - Forum software by © MyBB