Parameters

Estimated reading: 1 minute 250 views

$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;

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

Parameters

Or copy link

CONTENTS
Scroll to Top