#22763 closed defect (bug) (invalid)
add_query_arg() returns the ajaxurl
Reported by: | Gualtieri | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4.2 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
When calling any function that uses add_query_arg() by ajax, the result url is "/wp-admin/admin-ajax.php".
When using get_pagenum_link(2) for example, the result will be "www.example.com/wp-admin/admin-ajax.php?paged=2".
Change History (5)
#2
@
12 years ago
- Keywords close added
I had this once when requesting a part of a template through ajax. WordPress can't really do something with this. It's all to the ajax method to handle this and I guess this is a custom AJAX method.
The only thing you can do is set $_SERVERREQUEST_URI? to the value you want it to be.
#3
@
12 years ago
- Resolution set to maybelater
- Status changed from new to closed
In my case, theres an ajax call that loads the pagination after the page load.
Whats happening is that add_query_arg() is getting the ajax url instead of the current user url.
I was wondering if wasnt any way to check if it is an ajax call and treat it different, facing it as an enhancement or something like this.
Ill close it.
What resource would you expect get_pagenum_link() to return a page number for?