Friday, 15 July 2016

Solution to “Font from origin ‘http://cdn.domain.com’ has been blocked from loading by Cross-Origin Resource Sharing policy”

Source : Solution to “Font from origin ‘http://cdn.domain.com’ has been blocked from loading by Cross-Origin Resource Sharing policy”
Published On : July 15, 2016 at 12:38PM
By : Collins Agbonghama

I recently discovered icon fonts on the website of my ProfilePress WordPress plugin weren’t displaying. On viewing my browser console, i saw the following error notice logged.

Font from origin ‘http://ift.tt/2a2RPBe; has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://profilepress’ is therefore not allowed access.

Apparently, the browser was blocking connection from profilepress.net to its cloudfront CDN because of the restriction of browser’s same origin policy whereby siteA cannot fetch content from siteB unless via Cross-Origin Resource Sharing (CORS) in which response from siteB include a Access-Control-Allow-Origin header granting permission to siteA.…



For More Go to : W3Guy – A Geek's Diary

Labels:

Friday, 8 July 2016

How to Make WordPress Admin Notices Actually Dismissible

Source : How to Make WordPress Admin Notices Actually Dismissible
Published On : July 08, 2016 at 10:57PM
By : Collins Agbonghama

WordPress 4.2 introduced a feature where admin notices can now be dismissed / removed from the admin page currently being viewed.

One caveat I discovered was, the dismissal do not persist across pages. That is, when you reload or navigate away from the current admin page to another, you will still see the notice.

I wrote a small library / plugin that elegantly solves this problem which i will be sharing to us.…



For More Go to : W3Guy – A Geek's Diary

Labels: