init(); ( new ACQUIS_Lead_Handler() )->init(); add_action( 'init', array( 'ACQUIS_File_Manager', 'register_post_type' ) ); if ( is_admin() ) { ( new ACQUIS_Admin() )->init(); ( new ACQUIS_P3_Admin() )->init(); add_action( 'admin_menu', 'acquis_lite_sort_menu', 99 ); } ( new ACQUIS_Shortcode() )->init(); ( new ACQUIS_Form_Shortcode() )->init(); ( new ACQUIS_Download_Controller() )->init(); add_action( 'init', array( 'ACQUIS_Form_Blocks', 'register' ) ); /** * Fired after Lite has fully booted. * The Pro plugin hooks here to load its classes safely. */ // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound do_action( 'acquis_lite_loaded' ); } // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound function acquis_lite_sort_menu() { global $submenu; $parent = 'acquisitionsuite'; if ( empty( $submenu[ $parent ] ) ) return; $order = array( // Lite core 'acquisitionsuite' => 1, 'acquisitionsuite-leads' => 2, 'acquis-submissions' => 3, 'acquis-analytics' => 4, 'acquis-form-builder' => 5, 'acquisitionsuite-files' => 6, // Pro CRM 'acquis-lead-scoring' => 7, 'acquis-automation' => 8, 'acquis-tags' => 9, 'acquis-pipeline' => 10, // Pro sequences 'acquis-sequences' => 11, 'acquis-email-queue' => 12, // Pro payments 'acquis-pay-orders' => 13, 'acquis-pay-transactions' => 14, // Settings & misc 'acquisitionsuite-integrations' => 15, 'acquisitionsuite-email-logs' => 16, 'acquis-export' => 17, 'acquisitionsuite-settings' => 18, 'acquis-payments-settings' => 19, 'acquisitionsuite-status' => 20, // License (Pro) — always last before upgrade 'acquis-license' => 21, // Upgrade to Pro (Lite only) — always last 'acquis-upgrade' => 22, ); usort( $submenu[ $parent ], function ( $a, $b ) use ( $order ) { return ( $order[ $a[2] ] ?? 99 ) - ( $order[ $b[2] ] ?? 99 ); } ); // When Pro is active and licensed, hide the Lite "Upgrade to Pro" page // from the menu — Pro users don't need an upgrade prompt. if ( class_exists( 'ACQUIS_License_Manager' ) && ACQUIS_License_Manager::is_active() ) { $submenu[ $parent ] = array_values( array_filter( $submenu[ $parent ], function ( $item ) { return ( $item[2] ?? '' ) !== 'acquis-upgrade'; } ) ); } }