Philip Newcomer

The Backwoods Coder

Skip to content
  • Home
  • WordPress Plugins
    • Author Post Ratings
    • Customizer Framework
    • Responsive Image Maps
    • Show Hidden Post Meta
    • Widget Output Filters
    • WP Stripe Email Receipts
  • Contact

PHP

Post navigation

WordPress Ajax Helper Library Released

Posted by Philip Newcomer

0

I’ve just released a new PHP library for simplifying Ajax requests in WordPress plugins and themes. It’s called WP Ajax Helper, and you can find it on GitHub and Packagist.
Continue reading →

Posted in News, PHP, Releases, WordPress

Tagged ajax, javascript, jQuery, json, library, php, WordPress

Dec·31

Better Human-friendly Time Ago PHP Function

Posted by Philip Newcomer

2

Last month I posted about a Human-friendly Time Ago PHP Function. Well, I’ve come across another way of doing it. This method has less code duplication, but is harder to understand at first glance. I prefer this method though, as it seems a bit more elegant than the other method. I’ve refined the code from the Stack Overflow post, and here’s what I have now.
Continue reading →

Posted in PHP

Dec·18

Human-friendly Time Ago PHP Function

Posted by Philip Newcomer

2

Say you want to get the amount which has elapsed in a human-friendly format. Something like “27 minutes ago” or “3 days ago.” If you’re using WordPress, there is a handy function called human_time_diff() which does just that. But if you’re not using WordPress, here is a PHP function which will do the same.
Continue reading →

Posted in PHP, Uncategorized

Nov·21

Post navigation

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Most Popular Content

  • How to Target Internet Explorer 10 and 11 in CSS
  • How to Filter the Output of any WordPress Widget
  • How to Delete all WordPress-generated Thumbnail Sizes
  • Get the Attachment ID from an Image URL in WordPress
  • How to Allow REST API Requests While Restricted Site Access is Active
  • Creating Custom RSS Feeds in WordPress - The Right Way
  • Add Post Categories to the Body Class in WordPress
  • Human-friendly Time Ago PHP Function
Tweets by @BackwoodsCoder

Recent Comments

  • rishi on How to Target Internet Explorer 10 and 11 in CSS
  • rishi on How to Target Internet Explorer 10 and 11 in CSS
  • Pascal on How to Delete all WordPress-generated Thumbnail Sizes
  • Milan Patel on How to Target Internet Explorer 10 and 11 in CSS
  • Jonathan on How to Target Internet Explorer 10 and 11 in CSS

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress | Theme: Reddle by WordPress.com.