Skip to content
Advertisement

Tag: query-variables

Issues when using WordPress rewrite rules then accessing parameter using get_query_var

I’m developing a WP plugin and have a WordPress URL: (e.g.: http://localhost/testsite1/coder/?id=66), and have attempted to add a rewrite rule to http://localhost/testsite1/coder/66/ using the following rule: I have registered a WP Query Var using: but when at URL http://localhost/testsite1/coder/66/, when I run code echo get_query_var(‘id’); nothing is displayed however when at URL http://localhost/testsite1/coder/?id=66 the echo statement will display 66. What

Getting current page url on wp-admin/admin dashboard?

Im trying to get the current page url while on the wp-admin/admin dashboard, is it possible? Im trying to use these codes but i can’t seem to get it to work. The output i wanted is like this: https://example.com/1/wp-admin/admin.php?page=test But instead, the output turns like this: /1/wp-admin/admin.php?page=test&=https://example.com/1 Any help is greatly appreciated Answer To retrieve the URL of the admin

Advertisement