Back to Top

Global Options in a Multi-site WordPress

19 OPINIONS!

Make use of get_site_option() and update_site_option() in a Multi-site environment.... more

Properly get your Plugin’s Path and URL

2 OPINIONS!

Yet another two undocumented WordPress functions that can help you tremendously when writing a plugin or theme.... more

Safely Redirect URLs in WordPress

Awaiting Opinion...

If you need to redirect your plugin or theme to untrusted URLs, it's best to use a function that only permits local ones.... more

Reset Post Data

4 OPINIONS!

When you use query_posts() or create a new WP_Query object to get posts from the database, it is necessary to reset the post data so that other portions of a particular page can display correctly.... more

Get the Number of Posts for Each Post Type

2 OPINIONS!

If you would like to show some statistics to your visitors such as how many posts you have, how many movies you own, etc. wp_count_posts() is the answer!... more

Check if a Hook is being Filtered

5 OPINIONS!

A somewhat not frequently used function that might help you determine whether a hook is being filtered or not.... more

Choose the Correct Theme Path and URL

3 OPINIONS!

This tip can be useful for any plugin that provides support for custom CSS files in a theme's folder.... more

Protect Shortcodes from wpautop and the likes

Protect Shortcodes from wpautop and the likes
4 OPINIONS!

It is typical for any WordPress blog owner to have a few (if not many) shortcodes defined in his or her installed theme or plugins. While some shortcodes will work perfectly, some, especially enclosing ones, will not. Most of the time the problems lie at WordPress's built-in formatting functions, famous one of which is wpautop().

There are actually countless support questions and articles about wpautop() and other formatting functions mangling the contents of... more

remove_filter() and remove_action()’s bug, bad for developers

remove_filter() and remove_action()’s bug, bad for developers
2 OPINIONS!

Developers who have used remove_filter() or remove_action() probably won't notice there's a bug that mysteriously makes those two functions break other filters or actions defined after they are used. The reason is unclear at the moment and bug reports have been fired but no milestone set for future releases, so I will just post the bug here and provide a (probably) neat workaround that allows you to bypass this bug.

To reproduce the... more

Selective Plugin Loading

Selective Plugin Loading
14 OPINIONS!

Using plugins for your WordPress website or blog is undoubtedly a must, but if you abuse them you might eventually find yourself in tight situations. Many plugins out there are poorly written and eat up a lot of memory, or even if they aren't they simply don't need to be included every single time.

For example, plugins that are designed specifically for the back-end such as TinyMCE Advanced, Ozh' Admin Drop Down Menu... more

Organizing Theme Files

Organizing Theme Files
Awaiting Opinion...

As a developer and also an end-user, I have been bothered by the same question again and again: How should I organize files within my theme's root and which themes can be considered as well-structured?

If you have read another article named WordPress Themes' Problems and How to Find Good Ones on BetterWP.net, you would know that WordPress Themes have many potential problems and one of which is about theme files' organization. Each... more

Using Global Variables in WordPress

Using Global Variables in WordPress
13 OPINIONS!

A global variable, as it name suggests, is simply a type of variable that is available for use within any fraction of your codes. PHP's global variables and all their glory can be used within WordPress to help you eliminate code duplication, and in some situations save you some database queries.

Even though many developers think that using global variable is simply a bad practice, if you use it the right way there... more

Page 2 of 2 1 2