Navigation überspringen

[Gelöst] Check whether parameter exist in shortcode

This support ticket is created vor 3 Jahre, 5 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Waqar vor 3 Jahre, 5 Monaten.

Assistiert von: Waqar.

Author
Artikel
#2255379

Dear Sir/Madam,

I know how to check whether the exist of a url parameter in condition

          [wpv-conditional if="( '[wpv-search-term param="wpvcategory"]' ne '' )"]
		<ul class="wp-block-latest-posts__list has-dates wp-block-latest-posts">
		<wpv-loop>
                    <li>[wpv-post-link]</li>
		</wpv-loop>
        [/wpv-conditional]

how about the parameter in shortcode?

#2255761

Hi,

Thank you for contacting us and I'd be happy to assist.

If you need to check for the value from the URL parameter in your custom shortcode/PHP code, you can use the "empty" function and the superglobal "$_GET".

Example:


if(!empty($_GET['wpvcategory']))
{
	$category = $_GET['wpvcategory'];
}

Relevant guides:
versteckter Link
versteckter Link

regards,
Waqar