'error', ) ); } ); $gatherpress_activation = false; } // Check if build directory exists. Show an admin notice if it doesn't. // This is crucial for first-time installations after cloning the repo, // as the build files are not committed to version control and must be // generated locally with npm. if ( ! is_dir( GATHERPRESS_CORE_PATH . '/build' ) ) { add_action( 'admin_notices', static function (): void { wp_admin_notice( sprintf( /* translators: %1$s: build command, %2$s: the plugin path */ esc_html__( // phpcs:disable Generic.Files.LineLength.TooLong 'Please run %1$s in the %2$s plugin directory to generate required assets. This is needed after first cloning the plugin for development.', // phpcs:enable Generic.Files.LineLength.TooLong 'gatherpress' ), 'npm run build', 'gatherpress' ), array( 'type' => 'error', ) ); } ); $gatherpress_activation = false; } return $gatherpress_activation;