2021-09-07 21:40:05 +02:00
var disqus _url = embedVars . disqusUrl ;
var disqus _identifier = embedVars . disqusIdentifier ;
var disqus _container _id = 'disqus_thread' ;
var disqus _shortname = embedVars . disqusShortname ;
var disqus _title = embedVars . disqusTitle ;
var disqus _config _custom = window . disqus _config ;
var disqus _config = function ( ) {
/ *
All currently supported events :
onReady : fires when everything is ready ,
onNewComment : fires when a new comment is posted ,
onIdentify : fires when user is authenticated
* /
var dsqConfig = embedVars . disqusConfig ;
this . page . integration = dsqConfig . integration ;
this . page . remote _auth _s3 = dsqConfig . remote _auth _s3 ;
this . page . api _key = dsqConfig . api _key ;
this . sso = dsqConfig . sso ;
this . language = dsqConfig . language ;
if ( disqus _config _custom )
disqus _config _custom . call ( this ) ;
} ;
( function ( ) {
2024-04-17 11:32:24 +02:00
// Adds the disqus_thread id to the comment section if site is using a WP block theme
var commentsBlock = document . querySelector ( '.wp-block-comments' ) ;
if ( commentsBlock ) {
commentsBlock . id = 'disqus_thread' ;
}
2021-09-07 21:40:05 +02:00
if ( document . getElementById ( disqus _container _id ) ) {
var dsq = document . createElement ( 'script' ) ;
dsq . type = 'text/javascript' ;
dsq . async = true ;
dsq . src = 'https://' + disqus _shortname + '.disqus.com/embed.js' ;
( document . getElementsByTagName ( 'head' ) [ 0 ] || document . getElementsByTagName ( 'body' ) [ 0 ] ) . appendChild ( dsq ) ;
2024-04-17 11:32:24 +02:00
} else {
console . error ( "Could not find 'disqus_thread' container to load DISQUS. This is usually the result of a WordPress theme conflicting with the DISQUS plugin. Try switching your site to a Classic Theme, or contact DISQUS support for help." ) ;
2021-09-07 21:40:05 +02:00
}
} ) ( ) ;