If you simply want to modify content to be output by the_content()
but after the shortcodes have been applied, there is a much simpler approach. Shortcodes are filtered in the_content
with priority 11 as can be seen in default-filters.php:
add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop()
So just write a filter function and hook it with a higher value for priority, so the content passes through it after shortcodes have been replaced.
public function __construct() {
add_filter( 'the_content', array( $this, 'wpse_253803_filter' ), 20 );
}
public function wpse_253803_filter( $content ) {
//do some stuff
return $content;
}