Category: Technology
-
Ninio’s Learning Notes [Reload]
I’ve decided to restart blogging and moved my blog from its old location (ninio.shtrak.eu) to the one here.
-
JS variable loaded using wp_localize_script is no longer available
TL;DR: Call the wp_localize_script after registering/enqueuing the script you are localizing. Recently (WP 4.1.4 / WP 4.2) my ajax scripts stopped working. I’ve noticed that it was caused by the fact that the variable for the ajax_url was undefined so for some reason it ws no longer loaded to the page. The reason turned out…
-
Retrieving data from a form created with Contact Form 7
If you want to get the data from a form created with Contact Form 7 you can use the ‘wpcf7_before_send_mail’ hook. In your functions.php or from your plugin add action like follows: add_action( ‘wpcf7_before_send_mail’, ‘my_plugin_wpcf7_before_send_mail’ ); function my_plugin_wpcf7_before_send_mail ( $contact_form ) { // TODO: get the data } Since version 3.9 Contact Form 7 removed $contact_form->posted data so…
-
geeneric.com is live
We at Shtrak have been working lately on a WordPress and WooCommerce based platform for online shops. You can create your eCommerce site for free on geeneric.com Let me know what do you think about our service – I’m open to any ideas for improvement!
-
The native Facebook app on Android is no longer forcing you to use Messenger
Today I found out that the native Facebook app is no longer forcing me to use Messenger! At least on my Nexus 4. Seems like in the end they understood that forcing a user to do something is never the right way. From now on feel free to uninstall the crappy Messenger and use the…
-
JavaScript Custom Events that are not DOM related
Events is a great technique to loose code coupling. JS Custom Events was a big step to help the front-end developers write better JS. Despite this there are many cases where you don’t have your app objects represented in the DOM tree. And do you always have to trigger this event to the DOM when you don’t actually…
-
[Tips and Tricks for Writing WordPress Themes and Plugins] Forcing the browser to refresh your scripts and styles
I’m starting a some kind of thread of posts where I write down some of the nice tricks I meet in WordPress development. First one is how to write your custom theme and plugin files so after each deployment / update you’ll be sure that the browser doesn’t use the cached version of your JS and CSS.…
-
Leaflet tiles: Failed to load resource: the server responded with a status of 403 (Forbidden)
If you recently encounter a 403 error for your Leaflet tiles and your map is just showing gray it’s most likely that you’re using the tiles from Cloudmade which decided to discontinue their MapTile service for non-enterprise users. The easiest way to fix it is to change the cloudmade tile url: var tileUri = ‘http://tile.cloudmade.com/APIKEY/88233/256/{z}/{x}/{y}.png’; With…
-
jQuery error .apply( matched.elem, args ); undefined is not a function
If you’re having an error in your site/app that says that is undefined is not a function and the error happens on the row containing .apply( matched.elem, args ); (jquery.js:4676 for version 2.0.3). You can do the following 2 things to figure out the error: 0. You need Chrome Dev Tools 1. Enable async for your dev…
-
It’s time to stop fooling ourselvs with touch device detection
To all you JS guys out there: It’s time to stop fooling ourselves. The fact that a user has a touch capable device doesn’t mean he’ll be using it with touch only. Not sure what I’m talking about? There you go: var clickEventToUse = ( ‘ontouchstart’ in window ? ‘touchend’ : ‘click’ ) Still not sure? Now…