title: How to convert query sql to shortcode in wordpress?
body: <p>I want to make a shortcode like this [myshorcode:2:drinks], and query-wrangler I have managed to get the following query that shows me 2 products of a certain taxonomy</p>
  
  <p>PHP WP_Query:</p>
  
  <pre><code>$query = array (
    'paged' =&gt; 1,
    'posts_per_page' =&gt; '2',
    'offset' =&gt; 0,
    'post_status' =&gt; 'publish',
    'ignore_sticky_posts' =&gt; 0,
    'orderby' =&gt; 'date',
    'order' =&gt; 'DESC',
    'tax_query' =&gt; 
    array (
      0 =&gt; 
      array (
        'taxonomy' =&gt; 'product_brand',
        'field' =&gt; 'id',
        'terms' =&gt; 
        array (
          0 =&gt; 30,
        ),
        'operator' =&gt; 'IN',
        'include_children' =&gt; false,
      ),
    ),
    'post_type' =&gt; 
    array (
      'product' =&gt; 'product',
    ),
  );
  </code></pre>
  
  <p>This query works well but doesn't give me the option to put the name of the taxonomy, just the id.</p>
  
  <p>That's why I would like to make a shortcode where I put [product:2:name-taxonomy] or [product:name-taxonomy], and the 2 I leave it fixed.</p>
  
  <p>Thank you for your opinions and help.</p>