WP Manifestindependent plugin directory
manifest / developer / htmxer

@ HTMXer

HTMX for WordPress

by aiiddqd · github.com/aiiddqd/htmxer · website

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/aiiddqd/htmxer/archive/refs/heads/main.zip

HTMX for WordPress

example

initial HTML with HTMX

<div hx-get="/wp-json/htmxer/toolbar" hx-trigger="load delay:0s" hx-swap="outerHTML"></div>

url https://github.com/aiiddqd/aab/blob/main/main.php

AJAX response

add_action('htmxer/toolbar', function ($context) {
    echo 'Hello World';
});

Context (optional)

add_filter('htmxer/context', function ($context) {
    global $wp;
    $post_id = get_post()->ID ?? null;
    $context['post_id'] = $post_id;
    $context['url'] = site_url($wp->request);
    return $context;
});