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

  • Home
  • SEARCH
  • 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 6244299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:18:10+00:00 2026-05-24T12:18:10+00:00

i am building a plugin for wordpress. At first, i was accounting with the

  • 0

i am building a plugin for wordpress. At first, i was accounting with the default settings, where the URL of a post would be http://localhost/worpress/?p=123, and I was asking for is_single() in the wp_footer action.

When my plugin was ready, i went to try to cleanup my code. There are (at least) two things that i’m getting wrong:

  1. Why does it return false, when i ask for is_single() in the init action or something sooner than wp_footer?
  2. Why, when i try a var_dump($_REQUEST) (or _POST, or _GET) anywhere in my page cycle, i get an empty array, after switching the permalink options to url_friendly type?

Can anyone shed a light on this, please?

  • 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-05-24T12:18:11+00:00Added an answer on May 24, 2026 at 12:18 pm

    Question 1:

    • is_single() will only return true if you are on a single post
    • the init action hook occurs really early in the cycle; if you call is_single before the WP_Query is instantiated you’ll get false.

    To figure out whether you’re calling is_single too early set define('WP_DEBUG', true); in wp-config.php. This is on line 81 of my version of wp-config. You will see an error message from WordPress if you’re calling it too early. (Plus it’s a good tool to use during development.)

    Question 2:

    You’re not getting $_REQUEST parameters after switching to friendly URL’s because friendly URLs don’t have a querystring (the name/value pairs that occur after the question mark in something like http://localhost/worpress/?p=123.) Note that http://localhost/worpress/foo/bar doesn’t have a question mark.

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

Sidebar

Related Questions

I'm building a plugin assembly and I would like to provide an accompanying config
I am building out my first WordPress site for a client. I really want
I am currently building my first Immediacy Plugin, and do not have access to
I'm building a plugin to WordPress and so far so good with the PHP
I'm building a Wordpress theme, and I would like it to work without having
I'm building a plugin which will pull custom meta post automatically. For example if
I'm building a wordpress plug-in but I'm thinking first of looking into an Open
I'm building a WordPress plugin that pulls lat longs from a MySQL database and
I create a WordPress plugin and I like to post posts from WordPress in
I'm building a Wordpress site using Sencha Touch. I've created a plugin that converts

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.