setup_hooks(); } /** * Set up hooks for various purposes. * * This method adds hooks for different purposes as needed. * * @since 1.0.0 * * @return void */ protected function setup_hooks(): void { $render_block_hook = sprintf( 'render_block_%s', self::BLOCK_NAME ); add_filter( $render_block_hook, array( $this, 'attach_modal_open_behavior' ) ); add_filter( $render_block_hook, array( $this, 'attach_modal_close_behavior' ) ); } /** * Attaches modal open behavior to elements with the class 'gatherpress-modal--trigger-open'. * * This method scans the block content for elements containing the 'gatherpress-modal--trigger-open' * class. If such elements are found, it applies the appropriate interactivity attributes * for opening modals. If the target element is not a link (``) or button (`