asset_manager = $asset_manager; $this->product_helper = $product_helper; } /** * Returns the conditionals based in which this loadable should be active. * * @return array */ public static function get_conditionals() { return [ User_Profile_Conditional::class ]; } /** * Initializes the integration. * * This is the place to register hooks and filters. * * @return void */ public function register_hooks() { \add_action( 'show_user_profile', [ $this, 'add_hook_to_user_profile' ] ); \add_action( 'edit_user_profile', [ $this, 'add_hook_to_user_profile' ] ); } /** * Enqueues the assets needed for this integration. * * @return void */ public function enqueue_assets() { if ( $this->product_helper->is_premium() ) { $this->asset_manager->enqueue_style( 'introductions' ); } } /** * Add the inputs needed for SEO values to the User Profile page. * * @param WP_User $user User instance to output for. */ public function add_hook_to_user_profile( $user ) { $this->enqueue_assets(); echo '
'; /** * Fires in the user profile. * * @internal * * @param \WP_User $user The current WP_User object. */ \do_action( 'wpseo_user_profile_additions', $user ); echo '
'; } }