From 992d961066f1f5357ab0048c799c9b614fb2c564 Mon Sep 17 00:00:00 2001 From: magdev Date: Tue, 3 Feb 2026 17:18:46 +0100 Subject: [PATCH] Fix CF7 tag generator buttons not appearing in admin (v0.7.2) Moved CF7 initialization from init_frontend() to init_components() so tag generators register in admin context via wpcf7_admin_init hook. Co-Authored-By: Claude Opus 4.5 --- CHANGELOG.md | 8 ++++++++ src/Plugin.php | 11 ++++++----- wp-bnb.php | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6be08..5d92bd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.2] - 2026-02-03 + +### Fixed + +- CF7 tag generator buttons not appearing in admin form editor + - Moved CF7 initialization from frontend-only to run in both admin and frontend contexts + - Tag generators now properly register via `wpcf7_admin_init` hook + ## [0.7.1] - 2026-02-03 ### Added diff --git a/src/Plugin.php b/src/Plugin.php index 15c29f6..b227373 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -134,6 +134,12 @@ final class Plugin { // Initialize auto-updater (requires license configuration). $this->init_updater(); + // Initialize Contact Form 7 integration if CF7 is active. + // This runs in both admin (for tag generators) and frontend (for form rendering). + if ( class_exists( 'WPCF7' ) ) { + CF7::init(); + } + // Initialize admin components. if ( is_admin() ) { $this->init_admin(); @@ -203,11 +209,6 @@ final class Plugin { // Register widgets. add_action( 'widgets_init', array( $this, 'register_widgets' ) ); - - // Initialize Contact Form 7 integration if CF7 is active. - if ( class_exists( 'WPCF7' ) ) { - CF7::init(); - } } /** diff --git a/wp-bnb.php b/wp-bnb.php index 167e0fe..ca69b89 100644 --- a/wp-bnb.php +++ b/wp-bnb.php @@ -3,7 +3,7 @@ * Plugin Name: WP BnB Management * Plugin URI: https://src.bundespruefstelle.ch/magdev/wp-bnb * Description: A comprehensive Bed & Breakfast management system for WordPress. Manage buildings, rooms, bookings, and guests. - * Version: 0.7.1 + * Version: 0.7.2 * Requires at least: 6.0 * Requires PHP: 8.3 * Author: Marco Graetsch @@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) { } // Plugin version constant - MUST match Version in header above. -define( 'WP_BNB_VERSION', '0.7.1' ); +define( 'WP_BNB_VERSION', '0.7.2' ); // Plugin path constants. define( 'WP_BNB_PATH', plugin_dir_path( __FILE__ ) );