Workflow and best practice for documentation [closed]

Great question. There is no generic and comprehensive documentation workflow in WordPress circles. However there are some nice tools and options to make use of. readme.txt Markdown-based machine-readable file. It’s main purpose is to be parsed and presented by official plugin repository, but it’s not too convenient outside of that. It is great and fitting … Read more

Star rating for custom post types [closed]

For any rating functionality I always turn to GD Star Rating by Milan Petrovic. This plugin can do SO many things, including thumb rating, rating of comments, multiple ratings, etc. It can also handle Rich Snippets (for getting your star ratings shown in Google SERPs), caching mechanisms, etc.. In short, it can do a lot, … Read more

Theme and Plugins sharing common libraries

Can a theme or plugin go and fetch another plugin and install it? For themes, it’s rather straighforward. See https://github.com/thomasgriffin/TGM-Plugin-Activation For plugins, it’s trickier, since you can’t bundle the same boilerplate code in more than one plugin. See http://wordpress.org/extend/plugins/plugin-dependencies/

How can I make the “Preview Post” button save and preview in the same window?

Here’s a way to do it without modifying the core: add_action(‘admin_footer’,’preview_same_window’); function preview_same_window(){ ?> <script type=”text/javascript”> jQuery(function($){ jQuery(‘.preview.button’).unbind().removeAttr(‘target’); setTimeout(function(){ jQuery(‘.preview.button’).unbind().removeAttr(‘target’); },250); }); </script> <?php }

Akismet plugin is deleting spam despite preferences

I would generally not recommend modifying files for Plugins that you do not control. Better would be to write your own site/custom Plugin, to control this hook: add_action(‘akismet_scheduled_delete’, ‘akismet_delete_old’); First, to stop the deletion altogether, simply call: remove_action(‘akismet_scheduled_delete’, ‘akismet_delete_old’); Then, you can set up a cron job (or similar), to fire the akismet_delete_old() function on … Read more

How to delete terms on plugin deactivate?

I recommend not deleting the terms at the point of deactivation. Instead why don’t you delete the terms at the point of uninstallation? You can use the uninstall hook: http://codex.wordpress.org/Function_Reference/register_uninstall_hook Or bypass that. The plugin should create a file named ‘uninstall.php’ in the base plugin folder. This file will be called, if it exists, during … Read more