namespace HivePress\Components;
use HivePress\Helpers as hp;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
final class Foo_Bar extends Component {
public function __construct( $args = [] ) {
// Attach functions to hooks here (e.g. add_action, add_filter).
add_action( 'template_redirect', [ $this, 'redirect_page' ] );
parent::__construct( $args );
public function redirect_page() {
// Implement the attached function here.
public function do_something() {
// Implement the helper function here.