Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8179273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:57:54+00:00 2026-06-06T23:57:54+00:00

I am creating a plugin which has just one setting which is set with

  • 0

I am creating a plugin which has just one setting which is set with add_option('myinfo') in my main plugin php file. However, I have a second php file which is almost freestanding, except that I want it to get that setting. I tried using get_option('myinfo'), which works in the first file, but in the second file, it gives this error:

Fatal error: Call to undefined function get_option()

Basically, I think that my second php file is totally outside of WordPress. No WordPress specific code works, it just acts like some regular php file. How can I get the php file to have access to the WordPress database?

The file is mostly standalone, all it does is respond to an Ajax request, but I just want it to have this one piece of data from my plugin.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:57:56+00:00Added an answer on June 6, 2026 at 11:57 pm

    I haven’t tried it, but this page gives some details of how to include WordPress functions in a standalone page.

    This answer covers some of the same ideas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a webpage which uses jquery.transit plugin. I download the .js file and
I am creating one little plugin for WordPress which is about trips. I am
I have modified the buddypress admin bar by creating the following plugin which adds
I am creating a plugin for TinyMCE, which is basically a form that has
I'm creating an extjs grid panel which has a user configurable set of columns.
I am creating a home automation app that has allows plugin views. I have
I have the following problem: I am creating a simple plugin jquery carousel, to
I have a plugin which is applied on few element. Is there any way
I'm creating a page which has a series of div tags with background colours
I am creating a Jira plugin which provides a version tab panel. In the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.