docs(02-01): complete provider registration form plan
Phase 2 Plan 1 execution summary: - Created Formidable registration form with 5 German-labeled fields - Implemented auto-login and ddhh_provider role assignment - Email uniqueness and password validation enforced - Organization name stored as user meta - All tasks completed successfully with 2 commits Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,9 @@ class DDHH_JM_Activator {
|
||||
// Register custom roles
|
||||
DDHH_JM_Roles::add_roles();
|
||||
|
||||
// Create provider pages
|
||||
DDHH_JM_Pages::create_provider_pages();
|
||||
|
||||
// Set flag to flush rewrite rules on next init
|
||||
set_transient( 'ddhh_jm_flush_rewrite_rules', 1, 60 );
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ class DDHH_JM_Job_Manager {
|
||||
|
||||
// Initialize Formidable Forms integration
|
||||
add_action( 'init', array( 'DDHH_JM_Formidable', 'setup_registration_hooks' ) );
|
||||
|
||||
// Initialize dashboard
|
||||
add_action( 'init', array( 'DDHH_JM_Dashboard', 'init' ) );
|
||||
}
|
||||
}
|
||||
|
||||
55
includes/class-pages.php
Normal file
55
includes/class-pages.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Pages Class
|
||||
*
|
||||
* Handles creation of plugin pages during activation
|
||||
*
|
||||
* @package DDHH_Job_Manager
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Pages functionality
|
||||
*/
|
||||
class DDHH_JM_Pages {
|
||||
|
||||
/**
|
||||
* Create provider pages on plugin activation
|
||||
*/
|
||||
public static function create_provider_pages() {
|
||||
// Create Anbieter Dashboard page
|
||||
self::create_dashboard_page();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create provider dashboard page
|
||||
*/
|
||||
private static function create_dashboard_page() {
|
||||
// Check if page already exists
|
||||
$existing_page_id = get_option( 'ddhh_jm_dashboard_page_id' );
|
||||
|
||||
if ( $existing_page_id && get_post( $existing_page_id ) ) {
|
||||
// Page already exists
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the dashboard page
|
||||
$page_data = array(
|
||||
'post_title' => 'Anbieter Dashboard',
|
||||
'post_name' => 'anbieter-dashboard',
|
||||
'post_content' => '[ddhh_provider_dashboard]',
|
||||
'post_status' => 'publish',
|
||||
'post_type' => 'page',
|
||||
'post_author' => 1, // Admin user
|
||||
);
|
||||
|
||||
$page_id = wp_insert_post( $page_data );
|
||||
|
||||
if ( $page_id && ! is_wp_error( $page_id ) ) {
|
||||
// Store page ID in options
|
||||
update_option( 'ddhh_jm_dashboard_page_id', $page_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user