Tag: JavaScript

  • Filename cache busting for WordPress styles and scripts

    WordPress adds the version identifier to the script and style resource as a query string. Most proxies don’t cache these resources. You should encode the version into the filename. A plugin can handle this for you.

  • How to enqueue the bundled jQuery in footer – The Right Way

    WordPress comes with many bundles JavaScript libraries which can be enqueued in header or footer. This article shows a clean and nice way to register the bundled jQuery for the footer to speed up the page rendering.

  • Change content of WordPress Editor Buttons

    Not every user likes the default settings how some buttons are displayed on the WordPress editor. As of right now, there is no possibility to adjust it directly via a filter. The following source code describes a solution to change the link buttons and their content to easily set links with custom values. The small […]

  • WordPress Options Passed To JavaScript #2

    In our first article of this mini series, I explained how to pass with JSON from PHP to JS. Alternativly you can do this with the WordPress function wp_localize_script(), but contains some pitfalls. Therefore this little tutorial, also you should think about it in advance about these two solutions.

  • WordPress Options Passed To JavaScript #1

    In WordPress you are not always in the PHP world and so you have to pass settings and data from the database to scripts sometimes. In many Plugins you can find solutions in loading the wp-load.php and therefore access to all features of WordPress. Long ago Otto (Samuel Wood) already referred to this fact and […]

  • Comment Length Limiter

    Comment Length Limiter

    If you have used Twitter, then you know that you are only allowed to type 140 characters in a single Tweet. There is a nice little number below the text field indicating how much is left to write.