Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

[SOLVED] global variables


 
Prev Previous Post   Next Post Next
  #1  
Old Apr 11, 2011, 03:03 AM
todo1979
 
8 posts · Apr 2011
[SOLVED] global variables

Hi to all,
maybe someone can help my with this one. On my local wamp server I have global variables activated and I can use sessions for one plugin I modified. The plugin in question is restrict-categories and based from which category (when a category is displayed I added a link to post-new.php) the user wants to post a new post it should give him the option to only check one category the post will be added to (basically all other categories are hidden except the one that the post will belong to).
In atahualpa center-column I added this:

session_start();
$eu_scattitle = single_cat_title("", false);
$eu_scatid = get_cat_ID($eu_scattitle);
$eu_curr_cat = get_category($eu_scatid);
$eu_slug=$eu_curr_cat->category_nicename;
$_SESSION['eu_slug'] = $eu_slug; //this is what I need to be stored and later use in restrict-categories

Now, because globals are disabled, the session variable is lost when the execution enters into another .php file.

Is there a way to declare the variable I need inside the center-column (or in one .php file that belongs to atahualpa) and later to be available in the restrict-categories function?... like global $wpdb; or something?

Thank you.
 

Bookmarks

Tags
global variables, todo1979



Similar Threads
Thread Thread Starter Forum Replies Last Post
FR: Add variables to the paths to images, headers, logo, favicon, etc. interfasys Atahualpa 3 Wordpress theme 0 Jan 22, 2011 11:58 AM
[SOLVED] Notices on undefined indexes, variables and deprecated functions Knut Sparhell New Versions, & Updating 1 Jan 3, 2011 08:07 AM
Can't get a second row to enter HTML variables Thomas Sidebars & Widgets 18 May 16, 2010 09:59 AM
Accessing PHP variables after header sent out twola Sidebars & Widgets 1 Oct 2, 2009 11:24 AM


All times are GMT -6. The time now is 11:14 PM.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.