Skip to main content

Salient Hooks and Filters

Salient's templates fire WordPress actions and filters at fixed points, so a child theme can add, replace or remove output without editing template files. The tables list every hook, where it fires, its type, and the theme's own callbacks already attached to it.

General Template Hooks​

HookDescriptionTypeHooked callbacks
nectar_hook_after_body_openDirectly after the body open tagActionnectar_skip_to_content_link
nectar_custom_js_after_body
nectar_hook_before_body_closeBefore body close tagAction
nectar_hook_after_outer_wrap_openAfter outer wrap open (#ajax-content-wrap)Actionnectar_fullscreen_blur_wrap_open
nectar_hook_before_outer_wrap_closeBefore outer wrap close (#ajax-content-wrap)Actionnectar_fullscreen_blur_wrap_close
nectar_hook_before_header_navBefore the Salient header navigation barActionnectar_material_skin_ocm_wrap_open
nectar_page_trans_markup
nectar_hook_404_content404 template contentAction

Header Navigation Hooks​

HookDescriptionTypeHooked callbacks
nectar_hook_before_logoBefore the header navigation logoAction
nectar_hook_mobile_header_menu_itemsItems to display in the mobile navigation header barActionnectar_mobile_header_persistent_items
nectar_hook_before_menu_itemsBefore the main navigation menu itemsAction
nectar_hook_before_pull_left_itemsBefore the "Pull left" navigation menu itemsAction
nectar_hook_pull_right_menu_itemsPull right menu itemsAction
nectar_before_header_button_list_itemsBefore the button based navigation menu itemsAction
nectar_hook_secondary_header_menu_itemsSecondary header layout menu itemsAction

Content Hooks​

HookDescriptionTypeHooked callbacks
nectar_hook_before_contentBefore page/post content beginsActionnectar_yoast_breadcrumbs
nectar_buddypress_title
nectar_fullpage_markup_open
nectar_hook_after_contentAfter page/post content endsActionnectar_fullpage_markup_close
nectar_after_archive_post_item_contentAfter blog post item content in blog archivesAction
nectar_post_grid_item_bg_markup_afterAfter post loop builder item image markupAction
nectar_post_grid_item_content_markup_beforeBefore post loop builder item contentAction
nectar_post_grid_excerptThe post loop builder item excerptFilter
HookDescriptionType
nectar_hook_before_footer_widget_areaBefore footer widgetsAction
nectar_hook_after_footer_widget_areaAfter footer widgetsAction
nectar_hook_after_wp_footerBefore closing body tagAction

Off Canvas Menu Hooks​

HookDescriptionType
nectar_hook_ocm_before_menuOff canvas menu before menu itemsAction
nectar_hook_ocm_after_menuOff canvas menu after menu itemsAction
nectar_hook_ocm_bottom_metaOff canvas menu in bottom meta sectionAction
nectar_hook_ocm_before_secondary_itemsOff canvas menu before secondary nav itemsAction

Filters​

Every filter below was read out of the theme or Salient Core source rather than compiled from memory, and each one names the value it receives.

Queries​

HookDescriptionType
nectar_blog_queryThe blog loop's query arguments, before the loop runsFilter
nectar_post_grid_queryThe Post Grid element's query argumentsFilter
nectar_post_grid_post_typesWhich post types the Post Grid element offersFilter
nectar_quick_search_queryThe header quick search's query argumentsFilter
HookDescriptionType
nectar_activate_transparent_headerOverrides the theme's decision to use the transparent header on a pageFilter
nectar_transparent_header_coloringForces the transparent header's light or dark coloringFilter
nectar_logo_urlWhere the logo links, home_url() by defaultFilter
nectar_logo_textThe text logo's string, the site name by defaultFilter
nectar_header_outer_classesClasses on the outer header elementFilter
HookDescriptionType
nectar_page_header_subtitleThe page header's subtitle textFilter
nectar_auto_page_header_bypassPost types that skip the automatic page header, an arrayFilter
nectar_page_header_height_valThe page header's heightFilter
nectar_page_header_bg_valThe page header's background imageFilter

Metaboxes on other post types​

Each takes the array of post types that gets the metabox, which is how the Salient options are added to a custom post type. See Add Salient Metaboxes to a Custom Post Type.

HookDescriptionType
nectar_metabox_post_types_page_headerPost types offered the page header metaboxFilter
nectar_metabox_post_types_post_headerPost types offered the post header metaboxFilter
nectar_metabox_post_types_fullscreen_rowsPost types offered full screen rowsFilter
nectar_metabox_post_types_navigation_transparencyPost types offered the navigation transparency optionsFilter

Performance​

HookDescriptionType
nectar_delay_js_script_listThe script handles the Delay JavaScript Execution option defersFilter
nectar_disable_deferred_cssTurns off deferred CSS loading when trueFilter
nectar_disable_third_party_lazy_loadingWhether the theme leaves third party lazy loading aloneFilter

Global sections​

HookDescriptionType
nectar_available_special_locationsThe special locations a global section can be assigned toFilter
nectar_global_sections_enabledTurns the global sections feature off when falseFilter
salient_global_section_allow_displayWhether a given global section renders on the current requestFilter

Default image sizes​

Each takes the WordPress image size an element requests, so a site can serve something smaller than full.

HookDescriptionType
nectar_default_column_image_sizeColumn background imagesFilter
nectar_default_row_background_image_sizeRow background imagesFilter
nectar_default_fancy_box_image_sizeFancy Box imagesFilter
nectar_default_flip_box_image_sizeFlip Box imagesFilter

Elsewhere​

HookDescriptionType
salient_default_copyright_textThe footer's default copyright lineFilter
nectar_font_awesome_6_enabledWhether Font Awesome 6 is loaded instead of 5Filter
nectar_multisite_options_allow_admin_edit_codeBooleanFilter