Hey guys, here's another simple fix for a WP_DEBUG error that is a good idea either way because it will bring you in line with WP standards. Currently, in wp-mobile.php, you run wp_enqueue_script() to add your admin JS in the main plugin context, with just an is_admin() check to make sure it only happens on admin screens. Instead you should create a script enqueuing function and attach it to the 'admin_enqueue_scripts' hook. The way you're doing it now causes a WP_DEBUG error as follows:
[10-Jan-2012 20:39:48] PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /path/to/site/wp-includes/functions.php on line 3589
The fix is very simple. Here's how it looks with your code from wp-mobile.php commented out and the better way added:
//if (is_admin()) {
// wp_enqueue_script('cfmobi_admin_js', trailingslashit(get_bloginfo('url')).'?cf_action=cfmobi_admin_js', array('jquery'));
//}
function cfmobi_admin_enqueue_scripts() {
wp_enqueue_script('cfmobi_admin_js', trailingslashit(get_bloginfo('url')).'?cf_action=cfmobi_admin_js', array('jquery'));
}
add_action('admin_enqueue_scripts', 'cfmobi_admin_enqueue_scripts');
Check out this codex article about admin_enqueue_scripts, it is very helpful and even outlines how you could target the JS to ONLY your admin page where it is needed:
http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
Thanks!
P.S. It seems like no one ever sees these bugfix posts I write on your forum. If there is a better place for me to contact your developers with free programming help please let me know. Your plugins are good but WP Mobile Edition is in dire need of an update to fix these little issues.