update_option creates an option, which empties on a blog reload

Where are you calling wp_applugin_options_process()? If you call it, and $_POST[“excludeid”] isn’t set, then you’re effectively calling: update_option(“wp_applugin_excludeids”, null ); So if you’re calling this function on every page load, or even just when your admin page is loaded, then you’re automatically deleting your option. You should put a check in your function to make … Read more

How to display an alert when deleting a plugin?

Consider using an external directory to store such dependencies for your scenario like WP_CONTENT_DIR.’/plugin-templates’ (other then your real plugin folder) or smth. And allow users to remove it manually when they really want to uninstall. I don’t think you should delete plugins to update them… BUT I NEVER USED THE DEFAULT UPDATER (I disable it … Read more

Looking for a photo management solution

WordPress is quite limited when it comes to managing media, it has no real media API, your best to look for a solution that specializes in photos, like Picasa, Smugmug, iPhoto, jalbum, etc. You can also integrate these services into WordPress since some of them have an API. If you need more features you should … Read more

How to add a custom form to a plugin’s setting page

The fourth parameter of add_menu_page is the menu slug. Hence the form action should start with: admin.php?page=vsp_settings_page, if you want to stay on said page. If your form is correctly written, it should populate the query string in the URL. You should have probably posted all your form’s markup. Is there something along the lines … Read more

using wp_cache in plugin

If you move to using BBpress 2, BBpress 2 uses custom post types and is a plugin of WordPress. This would let you do the above query using standard WordPress calls, and WP_Query. You would then automatically inherit all of the caching systems WordPress uses, and support for things like W3 Total Cache DB caching … Read more

Adding a jQuery modal dialog to the admin area

Don’t know if this could help you, I used this to manage a image field from a meta-box in the post admin page : add_action( ‘load-post.php’, ‘ImageOnSlider_scripts’ ); add_action( ‘load-post-new.php’, ‘ImageOnSlider_scripts’ ); function ImageOnSlider_scripts() { wp_enqueue_script(‘media-upload’); wp_enqueue_script(‘thickbox’); wp_register_script(‘my-upload’, WP_THEME_URL.’/js/name_of_script.js’, array(‘jquery’,’media-upload’,’thickbox’)); wp_enqueue_script(‘my-upload’); wp_enqueue_style(‘thickbox’); } and the JS : jQuery(document).ready(function() { jQuery(‘#upload_image_button’).click(function() { formfield = jQuery(‘#input-ImageOnSlider’).attr(‘name’); tb_show(”, … Read more

Using a Plugin to Show/Hide Content after Header?

You can use this library located at Github. <?php require ‘./facebook.php’; $facebook = new Facebook(array( ‘appId’ => ‘YOUR APP ID’, ‘secret’ => ‘YOUR API SECRET’, ‘cookie’ => true, // enable optional cookie support )); if ($facebook->getSession()) { PLACE YOUR WP LOOP HERE } else { echo ‘<a href=”‘ . $facebook->getLoginUrl() . ‘”>Login</a>’; ADD YOUR APP’s … Read more