Skip to content

Commit

Permalink
Ensure the audio controls render for non-logged in users. Ensure the …
Browse files Browse the repository at this point in the history
…dashicon font is loaded so the play and pause buttons render
  • Loading branch information
dkotter committed Feb 5, 2024
1 parent 3b7262a commit 9f13923
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/Classifai/Features/TextToSpeech.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function __construct() {
public function setup() {
parent::setup();
add_action( 'rest_api_init', [ $this, 'register_endpoints' ] );

if ( $this->is_enabled() ) {
add_filter( 'the_content', [ $this, 'render_post_audio_controls' ] );
}
}

/**
Expand All @@ -81,10 +85,6 @@ public function feature_setup() {

add_action( 'add_meta_boxes', [ $this, 'add_meta_box' ] );
add_action( 'save_post', [ $this, 'save_post_metadata' ], 5 );

if ( $this->is_enabled() ) {
add_filter( 'the_content', [ $this, 'render_post_audio_controls' ] );
}
}

/**
Expand Down Expand Up @@ -621,7 +621,7 @@ public function render_post_audio_controls( string $content ): string {
wp_enqueue_style(
'classifai-post-audio-player-css',
CLASSIFAI_PLUGIN_URL . 'dist/post-audio-controls.css',
array(),
array( 'dashicons' ),
get_asset_info( 'post-audio-controls', 'version' ),
'all'
);
Expand Down

0 comments on commit 9f13923

Please sign in to comment.