Title: Wildcard URL shortcode parameter
Last modified: January 2, 2023

---

# Wildcard URL shortcode parameter

 *  Resolved [zapappa](https://wordpress.org/support/users/lesarnott/)
 * (@lesarnott)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/)
 * I have the free version of WP Data Access (5.2.9) on ‘WordPress 6.1.1 running
   Astra Child theme’ with PHP 8.0 and I’m having a problem with URL shortcode parameters
   with wildcards.  I have tested with WA Data Access being the only active plugin.
   
   I am displaying event details and the issue I have is searching on a year which
   has to be extracted from a date string. This is a historical database and I have
   to work with it as is. The default WHERE clause is: YEAR(date) = YEAR(CURDATE())
   and the database _date_ column is: date    tinytext    utf8mb4_unicode_520_ci
   Yes    and that works just fine. In fact all the database accesses work fine 
   in your Query Builder or in phpMyAdmin , for example: [SELECT](https://fridayharborsailing.com:2083/cpsess0867610037/3rdparty/phpMyAdmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/select.html)*
   FROM `wpws_fhsc_calendar_events` WHERE [date](https://fridayharborsailing.com:2083/cpsess0867610037/3rdparty/phpMyAdmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/date-and-time-types.html)
   [LIKE](https://fridayharborsailing.com:2083/cpsess0867610037/3rdparty/phpMyAdmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html#operator_like)“
   2022%”The shortcode I’m using is:  [wpdataaccess pub_name=”fhsc_calendar_events”]
   which works fine without any URL parameter overrides.  However, when I try to
   use URL parameters like this: …?wpda_search_column_date=2020%the rendering does
   not complete and the Chrome console shows an uncaught error in wpda_datatables.
   js at line 323. Looks like decodeURIComponent doesn’t like the trailing % character?
   I tried 2020%25 to see if that would work and there was no error but nothing 
   rendered.**Uncaught Error**wpda_datatables.js?ver=5.2.9:323 Uncaught URIError:
   URI malformed    at decodeURIComponent (<anonymous>)    at String.<anonymous>(
   wpda_datatables.js?ver=5.2.9:323:28)    at Function.each (jquery.min.js?ver=3.6.1:
   2:3003)    at data (wpda_datatables.js?ver=5.2.9:319:12)    at Tt (jquery.dataTables.
   min.js?ver=5.2.9:4:25958)    at Jt (jquery.dataTables.min.js?ver=5.2.9:4:32745)
   at Object.success (jquery.dataTables.min.js?ver=5.2.9:4:6431)    at c (jquery.
   min.js?ver=3.6.1:2:28327)    at Object.fireWith [as resolveWith] (jquery.min.
   js?ver=3.6.1:2:29072)    at l (jquery.min.js?ver=3.6.1:2:80045)I also made a 
   quick test with [wpdadiehard project_id=”2″ page_id=”6″] and the table did render
   but the same uncaught error occurred immediately afterwards.I’d appreciate any
   advice you have on getting this working because my initial testing with your 
   plugin looks very, very promising!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16336574)
 * Hi [@lesarnott](https://wordpress.org/support/users/lesarnott/),
 * Thank you for reaching out. Can you share a link to this publication?
 * I wonder if date (your column name) could be a reserved word in jQuery DataTables?
   Could you do just a quick test: create a view using a different column name and
   test if it works with your view?
 * Thanks,
   Peter
 *  Plugin Contributor [Kim L](https://wordpress.org/support/users/kimmyx/)
 * (@kimmyx)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16370140)
 * Hi there,
 * I’m going to mark this as resolved as we haven’t heard from you in a while.
 * Feel free to create a new thread if you have other questions.
 * Thanks!
 *  Thread Starter [zapappa](https://wordpress.org/support/users/lesarnott/)
 * (@lesarnott)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16371718)
 * I exchanged a few emails with Peter and I’m still waiting for a reply to the 
   last email?
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16372522)
 * Hi [@lesarnott](https://wordpress.org/support/users/lesarnott/),
 * Sorry, I have no open mails! Nothing in my spam box as well.
 * Can you please resent your last mail? And sent it through the contact page on
   the plugin website as well? Just to be sure I get it…
 * Sorry for the inconvenience,
   Peter
 *  Thread Starter [zapappa](https://wordpress.org/support/users/lesarnott/)
 * (@lesarnott)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16373787)
 * Sorry Peter I checked in my _sent _and it appears I replied to your email which
   had a no-reply destination! Here it is:
 * Thanks for getting back.  I have another table (officers) that is simpler and
   doesn’t actually need a wild card because this table has a ‘year’ column, which
   is a _text_ type. Here is the columns list:
 * ![](https://i0.wp.com/fridayharborsailing.com/wp-content/uploads/FHSC/Documents/
   All/table.png?ssl=1)
 * Again, if I use your Query Builder it works fine, both with and without the %
   character:
 * SELECT * FROM `wpws_fhsc_officers` WHERE year LIKE “2021%”
 * SELECT * FROM `wpws_fhsc_officers` WHERE year LIKE “2021”
 * SELECT * FROM `wpws_fhsc_officers` WHERE year = “2021”In WPDA the default WHERE
   clause is **year=YEAR(CURDATE())** and it displays the officers for the current
   year with no problem.  The shortcode is **[wpdataaccess pub_name=”fhsc_officers”****]**
 * When I add the URL parameter without the % I see “No matching records found” 
   but no console error.
 * [https://fridayharborsailing.com/wp/view-officers/?wpda_search_column_year=2020](https://fridayharborsailing.com/wp/view-officers/?wpda_search_column_year=2020)
 * If I add the % character I see the console error (URIError: URI malformed)
 * [https://fridayharborsailing.com/wp/view-officers/?wpda_search_column_year=2020%](https://fridayharborsailing.com/wp/view-officers/?wpda_search_column_year=2020%)
 * Note: the “/wp” folder is a separate WordPress system for my testing.
 * Thanks, Les
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16377169)
 * Hi Les,
 * Thanks for the follow up!
 * The plugin expects a safe URL. A % is generally unsafe. You need to encode it
   to %25. If you create a search form, this happens automatically.
 * Here is an example:
   [https://wpdataaccess.com/publication-search-form-demo/](https://wpdataaccess.com/publication-search-form-demo/)
 * Please enter clara% and press the submit button. You’ll see in the URL that clara%
   is encoded to clara%25. When you remove 25 from your URL you’ll get the same 
   decodeURIComponent error on your console.
 * Does this solve the issue?
   Peter
 *  Thread Starter [zapappa](https://wordpress.org/support/users/lesarnott/)
 * (@lesarnott)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16383618)
 * I used 2022**%** at first because your documentation contains this example:
 *  YOUR-URL/?wpda_search_column_title=Last**%**
 * but in the initial post you can see that I also tried** %25**:
 * _I tried 2020**%25** to see if that would work and there was no error but nothing
   rendered._
 * I re-ran the same tests on the main issue (accessing the calendar) that actually
   needs the **%25** I have the same problems as before
 * [https://fridayharborsailing.com/wp/view-calendar/?wpda_search_column_date=2020%25](https://fridayharborsailing.com/wp/view-calendar/?wpda_search_column_date=2020%25)
 * However, I think I have found the cause of the problem. The calendar table is
   setup with the _Data Publisher/Advanced Settings/WHERE Clause_ containing** YEAR(
   date)=”YEAR(CURDATE())” **and I guess I was expecting the URL parameter to override
   the _Where clause_ if necessary but that appears to be not the case. If I remove
   the YEAR(date)=”YEAR(CURDATE())” from the W_HERE clause _and use the %25 it works
   perfectly. This means there is no configured default year but that’s an easy 
   change.
 * So, if you agree that this conclusion makes sense I thank you for your time and
   your patience.  You have a great plugin here!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Wildcard URL shortcode parameter’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [zapappa](https://wordpress.org/support/users/lesarnott/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/wildcard-url-shortcode-parameter/#post-16383618)
 * Status: resolved