Skip to content

Commit

Permalink
Merge pull request #695 from 10up/fix/666
Browse files Browse the repository at this point in the history
FE fixes for the Text to Speech controls
  • Loading branch information
iamdharmesh authored Feb 6, 2024
2 parents 3b7262a + 9f13923 commit 7fa4155
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 7fa4155

Please sign in to comment.