Questions tagged [parameter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Capture query param and insert into to form field

We use WordPress for our landing pages. We have a query param ?utm_source=some_string that we'd like to capture (or pass along as user navigates site) and then eventually append to URL when user ...
Meltemi's user avatar
  • 101
0 votes
0 answers
26 views

Embed dynamic php snippets with parameters in a blogpost

I have a setup where I embed some entities in my blogposts (products essentially) and then I have written a script and added to functions.php where I can all an API to get some metadata about each ...
ask's user avatar
  • 1
0 votes
0 answers
51 views

Prevent URL Parameter Affecting other WP Query

I have a loop the generates a list of custom post types as a menu: $loop = new WP_Query( array( 'post_type' => 'farm-shop', 'orderby' => 'menu_order', ) ); The menu ...
Kingsford's user avatar
1 vote
1 answer
215 views

How to handle Ajax Calls, when using same shortcodes (with different parameters, e.g. 'post-type')?

this is my very first question here. So please don't be too angry, if I miss something out or make mistakes while using the plattform. I was, of course, trying to find an answer on my problem first. ...
Diddi_83's user avatar
0 votes
1 answer
164 views

Registration fields prefilled with URL parameters

I’d like to invite some users via email to register and would like to prefill the user registration fields, such as A.) username and B.) email. Unfortunately it is not working and my JS skills suck... ...
VolkerHarz's user avatar
0 votes
0 answers
166 views

Adding query parameter to archive page returns 404

I've created a new post type called Creations. On the creations archive https://example.com/creations I am showing a grid of creation posts. If I add query parameter to the URL I get a 404, why is ...
odedta's user avatar
  • 66
0 votes
1 answer
147 views

How to pass username in affiliate link in wordpress website

I need to pass current logged in user in wordpress website as SUBID in the affiliate link as follows. Affiliate link format is like below. https://affiliatenetwork.com/track?id=myuserid&url=https:/...
Nitin S's user avatar
0 votes
1 answer
110 views

Warning at top of website & top menu gone

This warning has appeared at the top of our website, and our top menu bar has disappeared: Warning: call_user_func_array) expects parameter! +~ be a valid callback, function '...
user221064's user avatar
0 votes
1 answer
347 views

Passing values through url for checkbox fields with same name to get?

Look to this images For example chose "Ajna" then select "Residential and Hotel Apartment" after click Search Properties => I need to show items that have these categories <...
Marco Talaat's user avatar
0 votes
2 answers
383 views

How to get a page url segment on wordpress?

I've created a regular wordpress page named "user" which is using a custom template. This page is supposed to be called like so: www.site.com/user/<ID> Is it possible to get the ID ...
Ricardo Miguel's user avatar
1 vote
1 answer
260 views

Create URL with parameter for JQuery toggle status

Inherited a theme and cannot contact the original developer. In the site, there are toggles so that users can switch between English and Spanish versions of the content. The toggle JS is included in a ...
lushiris02's user avatar
0 votes
0 answers
367 views

Different url to same page (with dynamic content)

I have a custom php script that in a specific page of my wordpress website is generating a dynamic content (ie. page "mysite.com/citydetail" that will load a list of places specific for that ...
martin's user avatar
  • 11
4 votes
2 answers
171 views

Pulling a parameter out of the URL of a WP link without "?" or being sent to a different page

I have a specific requirement that my referral link be as simple as possible to type in manually (customer base is very low skilled) while simultaneously referring to an employee number who was ...
MrDysprosium's user avatar
0 votes
0 answers
66 views

Unable to display multiple parameters from url by javascript through shortcodes

From our CRM I can generate URL's for customers that includes parameters. I want to use the information stored in this parameters to show dynamic content to the customers. Example: www.example.com/...
Ricardio's user avatar
1 vote
2 answers
767 views

Add custom parameter to REST API request of a custom post type?

I registered a custom post type called wasb_message with show_in_rest set to true and rest_base set to 'messages' so the resource is reachable at endpoint https://mydomain/wp-json/wp/v2/messages (...
icolumbro's user avatar
1 vote
2 answers
2k views

Get value from shortcode to do something

For a project I want to use advanced shortcodes. Normally I define shortcodes within my PHP. This way it is always the information I have in my PHP-files that I show with my shortcodes (like [...
Ricardio's user avatar
1 vote
0 answers
117 views

Rewrite custom post type URL parameters

I would like to change the following parameterized URL: www.example.com/category/?keywords=&location=new-york&type=Wedding in this way: (invert city > category) www.example.com/category/...
Andrea Leo's user avatar
0 votes
1 answer
32 views

Append a parametter at first or last to a certain URL

I want to change a URL and want to add a parameter to the last or first of that URL. For example I have URL like below https://example.com/search/?cityId=49409&bedrooms=0&bathCount=0&...
Md. Amanur Rahman's user avatar
0 votes
2 answers
48 views

Add a paramter to page url

I have a custom page template products, so i get the url site.com/products. I want to add a parameter (for example product) to this url, so that I can access this page using url site.com/products/...
Jay's user avatar
  • 1
-1 votes
1 answer
3k views

How to pass parameters in wordpress shortcode?

Everything is working fine and it's displaying the comments of the current page with this shortcode [wpdiscuz_comments] using the code below. function my_wpdiscuz_shortcode() { $html = ""; ...
HNPSK's user avatar
  • 1
0 votes
1 answer
148 views

RTrouble passing arguments to action

I know there are several posts on this topic. I have followed many of them as well as other resources on the web and thought I had it down, but it does not seem to be working. In my case, I have 2 ...
Daveh0's user avatar
  • 189
0 votes
1 answer
34 views

Problem parsing long parameter in shortcode

I have created this shortcode and registered it: function product_paypal_button_display($atts){ //Make the PayPal variables available downstream. global $wpdb; global $...
James's user avatar
  • 341
0 votes
0 answers
83 views

Display value of the GET parameter in a new URL page

Here's what I'd like to achieve: retrieve the GET value of its parameter from http://mysite/testing/?name=302Beep store it in a cookie redirect to http://mysite/dashboard display '302Beep' in http://...
302Beep's user avatar
1 vote
0 answers
41 views

Adding parameters to password reset key

I'm trying to add in parameters to the url generated for password reset for a user. In this case I wanted to add a &lang parameter to determine a users selected language and set a cookie. How do I ...
HeyImArt's user avatar
  • 111
0 votes
2 answers
1k views

Can I pass parameters to the add_shortcode() function?

As the title states, I need to pass at least one parameter, maybe more, to the add_shortcode() function. In other words, those parameters I am passing will be used in the callback function of ...
Greeso's user avatar
  • 2,106
1 vote
1 answer
189 views

404 error when passing "cat" parameter to URL

I encounter a strange problem with our WordPress site. When I check the URL: https://www.example.com/outlook-repair/ Everything is fine. When I pass several parameters to the URL, for example: https:/...
alancc's user avatar
  • 41
1 vote
1 answer
174 views

Assign category to new post via URL

There are two post categories in my WordPress site, Blog category and News category. I want to create two links in admin dashboard, each of the links will open post-new.php but a different category ...
Debsmita Paul's user avatar
0 votes
1 answer
94 views

How to construct a dynamic rewrite rule for child pages that passes more than one query var

I get a 404 error parent-page/any-child-page/?var1=x&var2=y&var3=z This is what I have so far: I want to have the rule cover any child page add_rewrite_rule('^project-centers/(...
mmeehan's user avatar
0 votes
0 answers
502 views

What's the right way to validate JSON data coming from an AJAX POST request?

I'm building a little plugin with a send button: when clicked, the button calls (from the admin area) a rest api endpoint, passing JSON data through AJAX. Everything works very well and the callback ...
Life after Guest's user avatar
0 votes
1 answer
24 views

Show data obtained from a function and place it in a shortocode function

I'm new I need to put a value obtained from a function and put it in my shortocode function if you can help me thanks $a=4; // value obtained from another function my_function($a); function ...
Stymark's user avatar
  • 37
0 votes
1 answer
632 views

HTTP 403 Error when passing parameters to URL

Our website uses WordPress. When we visit URL https://www.datanumen.com/outlook-repair/?utm_source=adword via browser such as Chrome and FireFox, we can see everything is fine. However, Google Ads ...
alancc's user avatar
  • 41
0 votes
2 answers
922 views

Wordpress get parameter 'unapproved' and 'moderation-hash'

I have a blog site. And I found a suspicious access to my blog post from log. The url format is like this. https://example.com/my-post/?unapproved=420&moderation-hash=...
devcrazy's user avatar
  • 101
0 votes
0 answers
522 views

How do i fix this "call_user_func_array()" error

Please, somebody, help me out.. How do I fix this? I kept on receiving this each time I tried to register an account and create a subsite on the frontend of my WordPress multisite Warning: ...
Theophilus's user avatar
0 votes
0 answers
16 views

How can I pass instance via apply_filters as a parameter?

How can I pass instance via apply_filters as a parameter? $dt = new DateTime("now", new DateTimeZone($timezone_string)); $d = apply_filters( 'custom_date_format', $d, $dt ); UPDATE: It's my mistake. ...
hiyo's user avatar
  • 25
1 vote
0 answers
94 views

Is there a link parameter that will show me all my published pages?

Is there any way to display a loop of all the pages that are published on my website, via a link? (Even while logged out) For example, I can type in domain.com/?s=text and that will create a post ...
harvey's user avatar
  • 215
0 votes
1 answer
196 views

wordpress automatic URL 'page' parameter rewrite

I have noticed that on my wordpress installation the page domain.com/test?page=2 is redirecting to domain.com/test/2 I tried disabling all plugins and also used the default/different themes and ...
Tom's user avatar
  • 111
0 votes
0 answers
208 views

Add more than one query parameter onto wordpress url

As soon as someone clicks on an anchor tag in my website, I was planning to redirect to the same page containing the information added via two URL query parameters, and then access them with the $_GET ...
Joe's user avatar
  • 35
0 votes
0 answers
15 views

When calling a function with admin-ajax.php, what is the first parameter? [duplicate]

I'm trying to make a function that can either be called directly or via admin-ajax.php. Strangely, when calling it as an AJAX function, the first parameter's value is a blank string. function ...
Pikamander2's user avatar
0 votes
1 answer
52 views

How to ignore GET parameter that’s the same as a CPT slug?

I have a custom post type called newsletter. At the same time, an implemented analytics tool (not related to my CPT) uses newsletter as a GET parameter to track some incoming links (and I can’t change ...
mischnu's user avatar
  • 11
0 votes
1 answer
29 views

Get posts from year from URL

I've created a page that shows content from a specific year. The year will be defined in the url. Example url: https://mpdb.space/stats/tour/?year=2019 It works perfectly when I type year=2019 but ...
Dennis's user avatar
  • 135
0 votes
1 answer
138 views

Post title as link parameter

I have in the theme file single.php a link in it (example.com/cars/?aff=) in each post of my blog is displayed. That's how I integrated it: $html .="<a id='test' rel='nofollow' href='https://...
Mike's user avatar
  • 1
3 votes
2 answers
1k views

Why does WordPress automatically redirect URLs with the parameter "name=" to a different page?

How do I disable this automatic redirect of the name variable so that I can use it on my call booking landing page? I'm setting up a call booking page here: https://www.themcmethod.com/talk/ I want ...
John McIntyre's user avatar
0 votes
1 answer
1k views

Add a class with body_class to a specific url with parameter

i try to add a class to the body for a specific page/url, which has a parameter at the end. the url looks like this: https://sample-site.com/user/37/?um_action=edit with my code, the class is also ...
LovinQuaQua's user avatar
0 votes
1 answer
480 views

unique post in "$args" of wp_query display more than one post

I can't find the rights arguments to display only one post of a category when I click on a div. I call the post with Ajax and I display it in a div popup.Perhaps these arguments are not sufficient, or ...
Rak Arthus's user avatar
0 votes
1 answer
239 views

add_action with associative array

I am trying to get these parameters from the do_action placed inside body: do_action( 'custom_action', array( 'product_id' => $product_id , 'outbiddeduser_id' => $outbiddeduser, 'log_id' =>...
Tahi Reu's user avatar
  • 206
0 votes
1 answer
13k views

Set A Cookie To URL Parameter, Pass Cookie From Page To Page To Alter Post

I have a function that makes the post multipage based on a URL Parameter with a specific value: ?content=multipage The problem is that when a user clicks to the next page the URL parameter is ...
Discover's user avatar
0 votes
1 answer
155 views

Set URL Parameter Post Layout As Default

I have 2 urls: www.site.com/post1/ www.site.com/post1/?content=onepage I have the following function that controls the layout of the post through the URL parameters in BOLD: www.site.com/post1/?...
Discover's user avatar
0 votes
1 answer
1k views

How to pass username in url

I have several author page like mysite.com/author/username1 mysite.com/author/username2 I want to create a dynamic url like mysite.com/author/current_loggedin_username How to create this.
user172955's user avatar
0 votes
0 answers
1k views

Url parameter going to 404 not found

I am trying to get data from url query in my woocommerce website. But when I go to the link it redirects to 404 not found. If I remove the 'product' from the query and add something else it works fine....
Shojib Khan's user avatar
2 votes
1 answer
4k views

Can we access the REST request parameters from within the permission_callback to enforce a 401 by returning false?

From what I have tried and tested so far, the getters and setters do not work inside the function permission_callback. The alternate way would be to throw a custom 401 from the callback itself. Is ...
Muhammad Asif Mohtesham's user avatar