You might want to look into creating a MU (Must Use) plugin, see WordPress Codex. Within this file, you can include your library (using require
) or you could just tweak your library file a bit and use it directly as the MU plugin. The session_start()
and ob_start()
functions worked for me with ever-so-brief testing, but your mileage may vary so test test test 🙂
Related Posts:
- wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file
- Include WP_Query in my own PHP file?
- Include a external PHP file into a WordPress Custom Template
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- Include files in functions.php
- load/require specific php files for specific pages/templates/post types
- Display message once per session to users with a specific role
- How to log out everywhere else, destroy all sessions “all other devices”?
- Why does $_SESSION only work when I am logged in?
- How To Make Connection To WordPress Data Base In A Plugin?
- ob_get_clean returns empty string, ob_get_flush outputs string
- Renaming wp-content folder dynamically
- Fix 403 error on WordPress multisite network using subdomains
- Make WordPress upload directory outside wordpress root with custom url
- Notice: Constant already defined in wp-config.php on (non-existent) line?
- how to create and show sessions in word press?
- where to include a php file
- Should I store my Facebook access tokens?
- No wp-config.php file on local install of wordpress – site still displays
- Site Health : An active PHP session was detected
- How can I change WordPress domain from remote to localhost?
- Why am I getting ERR_NAME_NOT_RESOLVED when I add a site to my multisite installation? [closed]
- Include Class File in WordPress
- nowplaying.include.php Will Not Display Results
- Change title and meta description in included page (not template)
- Can I change a variable in a content part while calling it?
- the_author() not working outside the loop
- Put CSS inside a PHP file and include it the right way
- Force SSL using FORCE_SSL_ADMIN
- How to expire session after 2 hours and also expire when browser closed?
- How can I resolve the php notice “Constant EMPTY_TRASH_DAYS already defined”
- functions.php is being included twice, creating PHP fatal errors
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- Fatal Error relating to sessions.php
- PHP help get_template_directory + PHP include
- code is skipping a div
- How to store post ID’s in cookie or session to display the same posts later
- Is it possible to increase php memory without directives in wp-config.php, .htaccess or php.ini?
- iframe does not store session/cookie when refresh parent
- Unique session WordPress
- PHP include is only working in certain places in my custom WP theme
- Correct and safe way to include php content in my page
- Get my site session in wordpress?
- Having Issue on Redirecting With Session in WordPress
- How to add API security keys into JS of wordpress securely
- Unset session variable on page reload / setup but exclude AJAX
- What is the proper way to include a PHP framework into my theme?
- Moving wordpress site from localhost to live server using GoDaddy cPanel
- What is the difference in the WP memory limits?
- php include not working in custom page
- Post’s ID pattern?
- Using WP functions such as the_title() in an included php file
- Set site title & tagline with wp.config or function.php
- $_SESSION variable not saving on page refresh or new page
- Use custom template on custom post type
- $_SESSION variables work perfectly on my local machine but returns NULL on development webserver
- How to include custom PHP file both in header and footer files
- Custom $_SESSION expires too early
- Can we stop session reset if page reloads?
- Store and Change Session variable – PHP SESSION VARIABLE
- Include a file that has a function in it
- How to decrease the max file upload size without using php.ini or htaccess?
- Deleting expired session tokens in WordPress
- PHP: $_SESSION destroyed after page reload for my custom session
- Set cookie parameters on wp site – PHP not working?
- Are there any drawbacks on opening a session_start in functions.php and header.php?
- How can I redefine WordPress wp-content directory programmatically?
- Like and Dislike Buttons on Post with Counter – Only allow one click per post per user session
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- PHP session not staying alive. headers already sent
- Site cannot access external connection
- Sessions with WordPress
- Before & After Content – After Content directly below Before Content when using require_once
- Use WP user status (logged_in) to manage access to independent application
- ajax polling with admin-ajax.php
- loading a php file to a specific page id
- Serve cookie free URLs in WordPress without using a CDN
- How do I fetch a data from an external database into my wordpress homepage
- How do I fetch a data from an external database into my wordpress homepage
- PHP Session Variable to WordPress Error
- PHP get_category() function redeclared
- I changed the password for the database user of my website, updated wp-config.php and wordpress asks to be reinstalled
- Resource 404 error on multisite subdirectory install
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- White screen after login attempt
- How can I include a file related to blog URL? Nothing seems to work
- WordPress blog set up
- Where are Sessions are being started? [closed]
- WordPress & PHP sessions
- Shortcode not passing variable to included file
- WordPress developer
- php “use” not working in template [closed]
- How to include a php file in every post and page [duplicate]
- Shortcode to include PHP file, pass various parameters to include?
- WordPress White Screen Error
- Difference between php memory limit and wp memory limit?
- How to transfer session after being redirected to other page
- Changing WP_MEMORY_LIMIT doesn’t affect actual memory limit
- Should I use include(_once) or require(_once) for loading php-file with customizer settings?
- PHP – Having $_SESSION as an array and adding $_SESSION to array