1. Home
  2. Docs
  3. Pro Version Documentation
  4. Advanced (For Developers)
  5. Parameters

Parameters

$snippet_name

(string) (required) The name of the snippet to retrieve.

$snippet_vars

(string) The variables to pass to the snippet, formatted as a query string.

Example

// Use query string for variables

$mySnippet = PostSnippets::getSnippet(‘internal-link’, ‘title=Awesome&url=2011/02/awesome/’);

echo $mySnippet;

// Use array for variables

$mySnippet = PostSnippets::getSnippet(‘internal-link’, array(‘title’ => ‘Awesome’, ‘url’ => ‘2011/02/awesome/’);

echo $mySnippet;

Was this article helpful to you? Yes No

How can we help?