wordpress 3.0 json issue

When I comment out the line: @header(‘Content-type: application/json; charset=UTF-8’); it works for me p.s. there is also a closing php opening tag in it without the word php there is a closing php tag at the bottom which can be gone there is a notice on an undefined index. better would be to use $charset … Read more

How to pass custom options from widget form to widget update callback?

Not sure if you’re still struggling with this, but for anyone that is, here’s the solution: Add the following arguments to wse_widget_context_form(): $widget, $return and $instance Then use the following to get field IDs and field names: <?php echo $widget->get_field_id(‘field_name’); ?> and <?php echo $widget->get_field_name(‘field_name’); ?> respectively. e.g. <li><label><input value=”on” type=”checkbox” name=”<?php echo $widget->get_field_name(‘noHome’); ?>” … Read more

How can I find the ‘public absolute’ path of a file?

Assuming your resource is included in your Plugin: plugins_url() is the URL to \wp-content\plugins\ (Codex ref) So if you have a .js file in \wp-content\plugins\plugin-slug\file.js: <?php echo plugins_url() . ‘\plugin-slug\file.js’; ?> BUT WAIT!! If your purpose is actually to load a javascript file, you actually want to enqueue that file, using wp_enqueue_script(), hooked into the … Read more

Why is the reset password key missing in the reset password email?

The site’s original developer was using the reset_password_message filter and had either done it incorrectly or the core code has changed. The following function now works: function reset_password_message( $message, $key ) { if ( strpos($_POST[‘user_login’], ‘@’) ) { $user_data = get_user_by(’email’, trim($_POST[‘user_login’])); } else { $login = trim($_POST[‘user_login’]); $user_data = get_user_by(‘login’, $login); } $user_login = … Read more