Quantcast
Channel: WordPress and Ajax » Code Snippets
Browsing latest articles
Browse All 8 View Live

Page Detection for Post Types in the Admin Menu

Someone over skype recently asked me: “How do you do page detection for a post type on the various post type admin pages?” After doing some research, I decided the best way was to use the WordPress...

View Article



WordPress Upgrade Class for Commercial or Client Plugins

If you have a plugin hosted outside of the official WordPress repo (whether commercial or for clients), one issue you’ll inevitably run into is how to utilize automatic upgrades. For my upcoming...

View Article

Quick Tip: Disallow File Editing on Client Dev Sites

If you’ve ever dealt with clients, you’ve probably also set up development sites to demonstrate plugins and/or themes. One danger before receiving final payment is the person ripping off your code...

View Article

wp_print_r – My favorite debugging function that isn’t included in core

if ( !function_exists( 'wp_print_r' ) ) { function wp_print_r( $args, $die = true ) { $echo = '<pre>' . print_r( $args, true ) . '</pre>'; if ( $die ) die( $echo ); else echo $echo; } }...

View Article

Image may be NSFW.
Clik here to view.

Delete Cron Jobs from WordPress

I recently had the struggle of deleting cron jobs from a site within a Multisite network. None of the delete cron functions seemed to work for me, so I wrote a function to brute-force it. I’m all ears...

View Article


Easy Lazy Loading Via Ajax

My friend Koop asked me over Twitter if there was an easy lazy-loading technique to load social media icons. Initially he wanted to load the icons over hover, but I talked him into doing it on a page...

View Article

A Custom the_content Filter

There have been numerous times when I needed the filter capabilities of the_content, but I didn’t want other plugin and/or theme authors to be able to hook into it and add in their own stuff. Here’s a...

View Article

Image may be NSFW.
Clik here to view.

Removing All Dashboard Widgets

Here’s a quick snippet for removing all Dashboard widgets in the admin area. As always, I’m game for a better way – Something about four foreach loops does not strike me as efficient. <?php //...

View Article

Browsing latest articles
Browse All 8 View Live




Latest Images