Skip to Content
Menu

twitter_widget_script()

Call the necessary Twitter widget.js for native Twitter buttons.

PHP April 27, 2017

Usage

This function runs automatically, so it is not called manually. Is this incorrect?

Additional Notes

This script only needs to be called once regardless of how many Twitter buttons are on the page.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /libs/Functions.php on line 1182.

    No Hooks

    This function does not have any filters or actions available. Request one?
    PHP
            public function twitter_widget_script(){
                if ( empty($this->twitter_widget_loaded) ){
                    ?>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                    <?php
                    $this->twitter_widget_loaded = true;
                }
            }
    

    Override

    This function can not be short-circuited with an override filter. Request one?