public function init()
    {
        self::$customerId = self::getOption('options_readspeaker-helper-customer-id');

        if (self::getOption('options_readspeaker-helper-read-wrapper-id')) {
            self::$readWrapperId = self::getOption('options_readspeaker-helper-read-wrapper-id');
        }

        add_action('wp_enqueue_scripts', array($this, 'enqueueScripts'));

        switch (self::getOption('options_readspeaker-helper-placement')) {
            case 'the_content':
                add_filter('the_content', function ($content) {
                    global $wp_query;

                    if (!in_array(get_post_type(), (array) self::getOption('options_readspeaker-helper-enable-posttypes')) || !in_the_loop() || !is_main_query() || is_comment_feed()) {
                        return $content;
                    }

                    do_action('ReadSpeakerHelper/before_the_readspeaker');
                    return $this->getReadSpeakerTag() . '<div id="' . self::$readWrapperId . '">' . $content . '</div>';
                });
                break;
        }
    }
public function init()
    {
        self::$customerId = self::getOption('options_readspeaker-helper-customer-id');

        if (self::getOption('options_readspeaker-helper-read-wrapper-id')) {
            self::$readWrapperId = self::getOption('options_readspeaker-helper-read-wrapper-id');
        }

        add_action('wp_enqueue_scripts', array($this, 'enqueueScripts'));

        switch (self::getOption('options_readspeaker-helper-placement')) {
            case 'the_content':
                add_filter('the_content', function ($content) {
                    global $wp_query;

                    if (!in_array(get_post_type(), (array) self::getOption('options_readspeaker-helper-enable-posttypes')) || !in_the_loop() || !is_main_query() || is_comment_feed()) {
                        return $content;
                    }

                    do_action('ReadSpeakerHelper/before_the_readspeaker');
                    return $this->getReadSpeakerTag() . '<div id="' . self::$readWrapperId . '">' . $content . '</div>';
                });
                break;
        }
    }
public function init ( ) { self :: $ customerId = self :: getOption ( 'options_readspeaker-helper-customer-id' ) ; if ( self :: getOption ( 'options_readspeaker-helper-read-wrapper-id' ) ) { self :: $ readWrapperId = self :: getOption ( 'options_readspeaker-helper-read-wrapper-id' ) ; } add_action ( 'wp_enqueue_scripts' , array ( $ this , 'enqueueScripts' ) ) ; switch ( self :: getOption ( 'options_readspeaker-helper-placement' ) ) { case 'the_content' : add_filter ( 'the_content' , function ( $ content ) { global $ wp_query ; if ( ! in_array ( get_post_type ( ) , ( array ) self :: getOption ( 'options_readspeaker-helper-enable-posttypes' ) ) || ! in_the_loop ( ) || ! is_main_query ( ) || is_comment_feed ( ) ) { return $ content ; } do_action ( 'ReadSpeakerHelper/before_the_readspeaker' ) ; return $ this -> getReadSpeakerTag ( ) . '<div id="' . self :: $ readWrapperId . '">' . $ content . '</div>' ; } ) ; break ; } }
Initialize the readspeaker
@return void
Initialize the readspeaker