Developer Guide
Hooks & Filters

Hooks & Filters Reference

AlonePro and its parent theme Nextora provide a rich set of action and filter hooks allowing developers to customize header markup, intercept cloud template imports, register custom color/font schemes, and extend theme functionality.


Nextora Cloud Templates Filter

nextora_cloud_templates_can_import

Gates or permits template imports via the REST API endpoint (POST /wp-json/nextora/v1/cloud/import).

apply_filters( 'nextora_cloud_templates_can_import', bool|WP_Error $allowed, WP_REST_Request $request ): bool|WP_Error

Parameters

ParameterTypeDescription
$allowedbool|WP_ErrorCurrent authorization state (default true).
$requestWP_REST_RequestThe active REST API request containing template_id and parameters.

Custom Access Authorization Example

Developers can restrict cloud template imports based on custom user roles or capabilities:

add_filter( 'nextora_cloud_templates_can_import', function( $allowed, $request ) {
    // Example: restrict template imports to administrators only
    if ( ! current_user_can( 'manage_options' ) ) {
        return new \WP_Error(
            'forbidden',
            __( 'You do not have permission to import cloud templates.', 'alonepro' ),
            [ 'status' => 403 ]
        );
    }
    
    return $allowed;
}, 10, 2 );

Nextora Header Action Hooks

All header hooks fire from blocks/header/render.php within the parent theme:

Hook NameDescription
nextora_header_block_beforeFires before the outer header markup opens.
nextora_header_block_afterFires after the outer header markup closes.
nextora_header_block_before_logoFires immediately before the site logo/branding markup.
nextora_header_block_after_logoFires immediately after the site logo/branding markup.
nextora_header_block_before_navFires immediately before the main navigation <nav> element.
nextora_header_block_after_navFires immediately after the main navigation <nav> element.
nextora_header_block_utilities_startFires at the beginning of the header utilities/actions column.
nextora_header_block_utilities_endFires at the end of the header utilities/actions column.
nextora_header_block_before_cartFires before the WooCommerce mini-cart trigger button.
nextora_header_block_after_cartFires after the mini-cart drawer markup.

Nextora Header Filters

Filter NameSignatureDescription
nextora_header_block_logo_link(string $url, array $atts): stringOverride the destination URL for the header logo.
nextora_header_block_nav_menu_args(array $args): arrayModify arguments passed to wp_nav_menu().
nextora_header_block_nav_aria_label(string $label): stringCustomize the accessibility aria-label on navigation.
nextora_header_block_nav_wrapper_classes(array $classes): arrayFilter CSS class array applied to <nav>.
nextora_header_block_menu_item_classes(array $classes): arrayFilter CSS class array applied to menu <li> items.
nextora_header_block_menu_link_attributes(array $attrs): arrayFilter HTML attributes on menu <a> anchor tags.
nextora_show_header_search_modal(bool $show): boolReturn false to completely disable the header search modal.
nextora_header_simple_search_placeholder(string $text): stringCustomize the search input placeholder text.
nextora_header_block_mini_cart_title(string $title): stringOverride the slide-out mini-cart drawer heading.
nextora_header_block_sticky_hide_after(int $px): intScroll threshold in pixels before hiding sticky header on scroll-down (default 72).
nextora_header_block_wrapper_classes(array $classes): arrayAppend or modify wrapper classes on the header block.

Color & Font Scheme Filters

Extend Nextora's scheme switcher with custom child theme color schemes and font pairings:

// Register custom color schemes into the frontend switcher
add_filter( 'nextora_color_schemes', function( array $schemes ): array {
    $schemes[] = [
        'slug'    => 'charity-emerald',
        'label'   => __( 'Charity Emerald', 'alonepro' ),
        'primary' => '#10B981',
    ];
    return $schemes;
} );
 
// Register custom font combinations
add_filter( 'nextora_font_schemes', function( array $schemes ): array {
    $schemes[] = [
        'slug'   => 'editorial-serif',
        'label'  => __( 'Editorial Serif', 'alonepro' ),
        'family' => 'Merriweather, Georgia, serif',
    ];
    return $schemes;
} );

Additional Nextora Filters

  • nextora_cloud_api_url: Override the remote Nextora Cloud API endpoint URL.
  • nextora_cloud_templates_allowed_tags: Filter the KSES allowed tags array applied when importing raw block HTML.
  • nextora_post_grid_query_args: Filter the WP_Query arguments for nextora/post-grid.
  • nextora_post_grid_output: Filter the final rendered HTML string for the post grid block.
  • nextora_comment_form_args: Filter parameters passed to WordPress core comment_form().
  • nextora_comment_tiptap_js_config: Modify the JavaScript configuration object for the Tiptap rich comment editor.