post ?? null; if ( empty( $post ) ) { return $data; } // Get the bricks edit link. $data['bricks']['editLink'] = \Bricks\Helpers::get_builder_edit_link( $post->ID ); } return $data; } /** * Check if the current page is rendered with Bricks. * * @return bool */ public function isRenderedWithBricks(): bool { return class_exists( '\Bricks\Helpers' ) && \Bricks\Helpers::render_with_bricks(); } }