Functions
You’ll find the function’s name, description, and other pertinent information in the list below.
Note
To view the complete function, look for it within Trellis Core’s functions.php file, located in mediavine-trellis/inc/functions.php.mv_trellis_entry_author
Outputs the entry’s author.
Parameters
- None
Return
stringThe author name.
mv_trellis_entry_content_class
Outputs a class attribute for the entry-content container. Includes classes specified by the mv_trellis_entry_content_classes filter.
Parameters
- $class
string|arrayA string or array of additional classes to be added to the entry-content class attribute.
Return
stringComplete list of classes to be added to the entry-content class attribute.
mv_trellis_entry_date
Outputs the entry publish date or updated date (if the entry has been updated).
Parameters
- None
Return
stringPublish date or updated date of the entry.
mv_trellis_entry_tags
Outputs a list of tags, if they exist, with optional content before or after the list.
Parameters
- $before
stringThe content to display before the tags. Defaults to empty. - $sep
stringThe separator to use between the returned tags. Defaults to comma. - $after
stringThe content to display after the tags. Defaults to empty.
Return
stringA list of tags with appended and prepended content, using specified separators.
mv_trellis_entry_taxonomies
Returns a list of taxonomies, if they exist.
Parameters
- $sep
stringThe separator to use for the taxonomies. Defaults to comma.
Return
stringA list of taxonomies with the separator between them.
mv_trellis_get_asset_url
Returns the absolute path of an asset.
Parameters
- $asset_path
stringAn optional relative path to the asset. Defaults to empty.
Return
stringThe absolute path to the asset.
mv_trellis_get_attachment_image_tag
Returns the best resolution image in an <img> tag with srcset data.
Parameters
- $img_id
int|stringImage attachment ID. - $img_size
stringImage size. Defaults to large. - $attributes
arrayA key/value array of attributes to be added (such as class). Defaults to none. - $highest_res
stringThe max resolution to allow. Defaults to null. - $lazy_load
boolWhether to add lazy load markup to the image. Defaults to True.
Return
string|nullThe HTML<img>tag or null if no image is available.
mv_trellis_get_child_theme
Gets the name of the child theme.
Note
Use this function when checking for the existence of Trellis.Return
string|nullName of the child theme or null if the name is not found.
mv_trellis_get_data
Gets data that has been previously set using the mv_trellis_set_data function. This is used for passing data across template parts.
Default
- Null, which returns all set data.
Parameters
- $data_key
string|nullKey of the data to retrieve. If no key is set, all data is retrieved.
Return
mixedData from a specified key or all data in anarray.
mv_trellis_get_featured_image_tag
Gets the HTML tag of the featured image.
Parameters
- $post_id
intOptional post ID. - $attr
arrayAttributes array. Defaults to empty. - $echo
boolWhether to echo the tag or return. Optional, but defaults to True.
Return
string|nullHTML of the featured image or null if$echois false.
mv_trellis_get_featured_post
Gets the ID of the featured/sticky post displayed on the home page.
Parameters
- None
Return
intThe ID of the featured post.
mv_trellis_get_template_part
Loads the found template part.
Parameters
- $slug
stringTemplate file (including path) to search for. - $name
string|arrayThemv_trellis_template_typewill search through the Trellis template hierarchy for the matching template name. Including an array will limit the files to search from what is specified in the array.
Return
stringThe HTML of the matching template part.
mv_trellis_get_term_description
Gets the specified term description. Checks for Genesis data if no description is found.
Parameters
- $term_id
intID of the term. Looks for the current term if an ID is not provided.
Return
stringHTML of the term description.
mv_trellis_get_wp_kses_post_with_images
Adds image and style related tags (including attributes) to the default list for posts. Used to sanitize Trellis DOM manipulations and image handling.
Parameters
- None
Return
arrayA list of image and style tags.
mv_trellis_has_flag
Returns whether any specified flags are found in the URL.
Parameters
- $flag
stringThe flag.
Return
boolWhether the specified flag exists in the URL.
mv_trellis_is_core
Returns whether Trellis Core is the active theme.
Note
Using the WP Core functionis_child_theme() is more reliable and is available earlier.Return
boolTrue if Trellis Core is the active theme, False if a Trellis child theme is active.
mv_trellis_is_meta_item_enabled
Checks to see if a meta option (like category count or author) is selected in a Post Meta location.
Parameters
- $item_slug
stringSlug of the meta item. - $meta_location
stringLocation of where the meta item is set to output. Trelis Core defaults to usingpost_meta_toporpost_meta_bottomas the possible locations.
Return
boolWhether the post meta item is set for the specified location.
mv_trellis_is_plugin_active
Checks to see if a plugin is active based on a specified slug.
Parameters
- $plugin_slug
string|arraySlug of the plugin or an array of slugs to check.
Return
boolTrue if the plugin is active, false if the plugin is not found.
mv_trellis_nav_menu
Outputs the nav menu with toggle button support.
Parameters
- $args
arrayArguments to be used in the corewp_nav_menufunction. - $toggle_btn
boolDisplays the toggle button. Defaults to False. - $toggle_text
stringText string to be used in the toggle button. Defaults to “Menu.” - $toggle_template_part
stringTemplate part to be used for the toggle button. This overrides$toggle_text. Defaults to null.
Return
stringThe HTML containing the navigation menu.
mv_trellis_output_sidebar
Outputs the sidebars. Content is first run through the mv_trellis_sidebar_content filter.
Parameters
- $sidebar_id
stringThe sidebar id to process.
Return
stringHTML content of the specified sidebar.
mv_trellis_purge_all_critical_css
Deletes all site Critical CSS and removes any pending rebuild requests.
Parameters
- None
Return
- Not applicable.
mv_trellis_purge_page_critical_css
Deletes Critical CSS files for a specific post or page.
Parameters
- $id
int|stringPost or page id. Used to get the post or page slug when the slug is not provided. - $slug
stringPost or page slug.
Return
- Not applicable.
mv_trellis_remove_data
Removes data from an array that was set using the mv_trellis_set_data function. Data in the array is available across template parts.
Parameters
- $data_key
stringThe key of the data to remove.
Return
- Not applicable.
mv_trellis_set_data
Sets data that can be used across template parts.
Parameters
- $data_key
stringKey of the data. - $data_value
mixedValue of the data.
Return
- Not applicable. Sets data for retrieval using
mv_trellis_get_data.
mv_trellis_site_title
Outputs the HTML of the site title and logo.
Parameters
- $link
boolWhether to display the site title and logo wrapped in an anchor tag. Defaults to True.
Return
stringHTML of the site title and logo.
mv_trellis_the_attachment_image_tag
Echoes the best resolution image in an <img> tag with srcset data.
Parameters
- $img_id
int|stringThe image attachment ID. - $img_size
stringThe image size. - $attributes
arrayA Key/value array of attributes added (such as class). - $highest_res
stringThe max resolution allowed. - $lazy_load
boolWhether lazy loaded markup is added to the image.
Return
string|nullThe HTML<img>tag or null if no image is available.
mv_trellis_the_posts_pagination
Displays archive/feed pagination controls using arguments passed by the mv_trellis_pages_pagination_args filter.
Parameters
- Customize arguments in your functions.php file by using the
mv_trellis_pages_pagination_argsfilter. See Filters for more information.
Return
stringHTML output of the pagination links.
mv_trellis_the_term_description
Echos the term description with optional content before and after. Checks for Genesis data if no description is found.
Parameters
- $before
stringContent to prepend to the term description. Defaults to empty. - $after
stringContent to append to the term description. Defaults to empty.
Return
stringThe term description, complete with any specified before or after content.
mv_trellis_the_title
Outputs a title (page, author, category, etc.) with optional content before or after.
Parameters
- $before
stringContent or markup to be output before the title. Defaults to empty. - $after
stringContent or markup to be output after the title. Defaults to empty. - $echo
boolWhether the title content will be echoed. Defaults to True.
Return
stringThe title, complete with optional content before or after.
mv_trellis_yoast_breadcrumbs
Outputs Yoast Breadcrumbs markup if Yoast SEO is available.
Parameters
- None
Return
stringHTML markup of Yoast breadcrumb data.
mvt_adjust_excerpt_image_orientation_res
Returns the specified resolution size for excerpt featured images.
Parameters
- $orientation
stringThe selected orientation for the image.
Return
stringThe resolution size.
mvt_adjust_excerpt_image_sizes
Adjusts the sizes attribute value for excerpt thumbnail images.
Default
- (max-width: 599px) 300px, 270px
Parameters
- $sizes
stringThe value of the image sizes attribute.
Return
stringThe adjusted sizes attribute value.
mvt_adjust_featured_post_image_orientation_res
Returns the specificed resolution size of the excerpt featured image for the featured post.
Parameters
- $orientation
stringThe selected orientation for the image.
Return
stringThe resolution size.
mvt_adjust_featured_post_image_sizes
Adjusts the sizes attribute value for the featured post thumbnail images.
Default
- (max-width: 340px) calc(100vw - 40px), (max-width: 450px) calc(100vw - 100px), (max-width: 959px) 350px, (max-width: 1134px) 275px, 350px
Parameters
- $sizes
stringThe value of the image sizes attribute.
Return
stringThe adjusted sizes attribute value.
mvt_get_image_orientation_res
Appends a filtered resolution size to the image orientation. Ensures the specific resolution size of the image is used.
Parameters
- $orientation
stringThe selected orientation for the image. Defaults to empty. - $image_res
stringThe selected resolution for the image.
Return
stringThe orientation with an appended resolution size.
mvt_title_after
Fires off the tha_title_after hook after the closing title </h1> tag (as long as the page title output isn’t hidden).
Parameters
- None.
Return
- Not applicable.
mvt_title_before
Fires off the tha_title_before hook before the title <h1> tag (as long as the page title output isn’t hidden).
Parameters
- None.
Return
- Not applicable.