Okay
  Public Ticket #2878182
placeholders
Closed

Comments

  •  2
    Barry Horsley started the conversation

    Is it possible to pass a placeholder through a URL parameter?

    I cannot find it in the documentation.

    https://wpdatatables.com/faqmd/use-url-parameters-filtering/

  • [deleted] replied

    Hi Barry

    Thank you for reaching out to us.

    Supposedly, your URL is https://yourwebsite.com/?value_x=123

    The data pulled from the database creates a table using a query similar to this:

    SELECT * FROM table WHERE value_x = %VAR1%

    After that, you can use a hook for dynamic placeholders (place it in functions.php of your theme, or your child theme):

    function updateVAR1($tableID){  global $wdtVar1;      //check is set GET parametar value_x    if(isset($_GET['value_x'])){        //get value from form field        $wdtVar1 = $_GET['value_x'];    }  }
    add_action('wpdatatables_before_get_table_metadata', 'updateVAR1');

    I hope this helps.