This section covers technical details for developers working with header and footer variation data programmatically.

Custom Post Type Details

HeaderFooter
Post typememberlite_headermemberlite_footer
PublicNo (admin-only, not queryable on the frontend)No (admin-only, not queryable on the frontend)
Block editorEnabled (show_in_rest is true)Enabled (show_in_rest is true)
SupportsTitle, Editor, Revisions, Custom FieldsTitle, Editor, Revisions, Custom Fields
CapabilitiesAll mapped to edit_theme_optionsAll mapped to edit_theme_options
Admin locationMemberlite > HeadersMemberlite > Footers

Theme Mods

  • Global header:memberlite_default_header_slug — stores the post_name (slug) of the assigned header variation, or '0' for the default header.
  • Global footer:memberlite_default_footer_slug — stores the post_name of the assigned footer variation, or '0' for the default footer.
  • Location-specific footers: Stored as separate theme mods for each content type (blog/archives, single posts, pages).

Post Meta

  • Per-page header override:_memberlite_header_override on page posts — stores the post_name of the assigned header variation.
  • Per-page footer override:_memberlite_footer_override on page posts — stores the post_name of the assigned footer variation.
  • Sticky header per-variation:_memberlite_header_sticky (boolean) on the memberlite_header post itself.

Filter Hooks

Cache

The list of header and footer variations is cached in transients (memberlite_header_variations and memberlite_footer_variations) for 12 hours. The cache is automatically cleared whenever a variation post is saved, trashed, or permanently deleted.

Cleanup on Deletion

When a variation post is permanently deleted, Memberlite automatically:

  • Removes the relevant theme mod if it referenced the deleted post.
  • Clears any per-page override meta values that referenced the deleted post.

This prevents orphaned assignments from leaving the Customizer dropdown or per-page settings pointing to a nonexistent variation.

Rendering

The memberlite_render_header_variation() and memberlite_render_footer_variation() functions look up the post by slug and render its block content via do_blocks(). If the post is not found or not published, they return false, and the theme falls back to the default header or footer template part.

Last updated on June 25, 2026


Was this article helpful?
YesNo