Questions tagged [parameter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
13 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 [...
0
votes
0answers
20 views

Pass a Parameter and Save an Option without Leaving the Page (and without using AJAX)

add_action( 'admin_notices', 'example_admin_notice' ); function example_admin_notice() { $user_id = get_current_user_id(); if ( !get_user_meta( $user_id, 'example_notice_dismissed' ) &&...
0
votes
0answers
34 views

Single pretty url query var parameter

I’ve registered a custom query var that I read from shortcodes running on a page ‘d’, so at the moment … [URL]/d/?v=value works. The page is essentially a template and the value is actually an author ...
1
vote
0answers
42 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/...
0
votes
1answer
21 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&...
0
votes
2answers
21 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/...
0
votes
1answer
61 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 = ""; ...
0
votes
1answer
57 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 ...
0
votes
1answer
18 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 $...
0
votes
0answers
12 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://...
1
vote
0answers
16 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 ...
0
votes
0answers
12 views

Losing get parameters when redirected due to old url

I have a WordPress site which people link to with some get parameters, basically like so: https://www.example.com/2020/09/01/my-slug?myParam1=something&myparam2=somethingElse Now I noticed that if ...
0
votes
0answers
16 views

Confirm order page parameter for woocommerce

I have custom payment button i put on woocommerce checkout page before confirm order page, and it will redirect to confirm order page after the payment have been made. The url look something like this ...
0
votes
2answers
119 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 ...
0
votes
0answers
21 views

can't get url parameters working with metadata for searching posts

I am trying to get a custom feild added as a search paramter url. my post metadata for this example is 'public_paywall' and want to register as it as a query var "access" This is the code I ...
0
votes
0answers
36 views

Login Redirect Based on Action Parameter in Login URL

I'm trying to redirect logged in users to a specific page based on what is in the login url. For instance, I have added an action parameter to the login url like this: https://mywebsite.com/wp-login....
1
vote
1answer
45 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:/...
1
vote
0answers
35 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 ...
0
votes
1answer
16 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/(...
0
votes
0answers
160 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 ...
0
votes
1answer
20 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 ...
0
votes
1answer
311 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 ...
0
votes
2answers
351 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=...
0
votes
0answers
101 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: ...
0
votes
0answers
12 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. ...
1
vote
0answers
32 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 ...
0
votes
1answer
85 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 ...
0
votes
0answers
54 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 ...
0
votes
0answers
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 ...
0
votes
1answer
39 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 ...
0
votes
1answer
9 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 ...
0
votes
1answer
33 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://...
3
votes
2answers
457 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 ...
0
votes
1answer
556 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 ...
0
votes
1answer
323 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 ...
0
votes
1answer
76 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' =>...
0
votes
1answer
8k 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 ...
0
votes
1answer
62 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/?...
0
votes
1answer
490 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.
0
votes
0answers
739 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....
2
votes
1answer
3k 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 ...
0
votes
1answer
540 views

Handle multiple parameters in filter

I am trying to setup a filter which supports more than one parameter: function FILTER_CALLBACK($block_id, array $items) { // How can I pass both parameters to the next hook? return $items; } ...
0
votes
2answers
119 views

How to use query string in URL to display content on the wordpress page

My wordpress page URL is like this https:www.com/thanks-page/?origin_name=Sydney&origin_iata=SYD&destination_name=Ahmedabad&destination_iata=AMD I need to display SYD and AMD in to the ...
0
votes
0answers
32 views

Add a url parameter to the current post and read it in a shortcode

I am trying to add a parameter to the currently visited url but it doesn't work. I've tried query_vars, pre_get_posts, post, post_link, page_link,post_type_link.... None of this work... How can I ...
0
votes
0answers
724 views

How Can I Display the Last Modified Date for User Profiles on WordPress?

I'm trying to add a "last modified" date to user profiles on WordPress. I'm using the Ultimate Member plugin, so I would prefer to to find a way to save this date to a meta-key that I can pull when I ...
0
votes
2answers
26 views

Add addtional page parameter before loading the page

the problem I got: I need to force a list view for products which are shown on a specific page only for mobile devices, for me the perfect solution would be an additional url parameter -> '&...
1
vote
1answer
141 views

How to Use Parameters with a Do_Action Function Within PHP Tags

I'm using a WordPress plugin that allows integration actions to integrate it within a theme. Using GeneratePress' Elements feature, I'm adding the action as a hook. Currently the code I'm using is: &...
0
votes
3answers
2k views

Custom HTML title based on URL parameter

Basically, we have alot of traffic coming to our site from different sources looking for slightly different things. But instead of creating new pages for each slight change in heading, we were ...
1
vote
1answer
2k views

Changing WP_Query params with url Query Var

:) I've used WP_Query to display there posts (travels) here http://boost19.delavec.si/wordpressP/produkti/ So... I've got this WP_Query that is looping through my custom posts <?php $paged = (...
0
votes
0answers
274 views

Add attribute to existing Shortcode

I have an existing shortcode (from a plugin) and I would like to add a new attribute or parameter to this shortcode. The shortcode looks like this: [my_shortcode_from_plugin_xyz posts="5" autoplay="...