wp is not defined error using wp.media to create a custom image uploader
Figured it out! I didn’t have the javascript code wrapped with the following: jQuery(document).ready( function($){ });
Figured it out! I didn’t have the javascript code wrapped with the following: jQuery(document).ready( function($){ });
You should not change anything in files inside wp-admin and wp-includes folder. All these files gets overwritten when WordPress is updated. The correct functions.php file is in your theme folder. full path to that file: wp-content/themes/YOUR-THEME-FOLDER/functions.php
It seems you need to use $errors = new \WP_Error(); in your code, since WP_Error isn’t part of your namespace. I ran a quick test on my machine, using wp-cli commands: Using new WP_Error(): % wp eval ‘namespace PJ\NS\Test; $x = new WP_Error(); var_dump( $x );’ Fatal error: Uncaught Error: Class ‘PJ\NS\Test\WP_Error’ not found in … Read more
Problem solved, I replaced all function calls that return HTML with : ob_start(); myFunctionDisplayHTML(); return ob_get_clean(); And the JSON response is valid. Thanks @phatskat, you got me on the right way 🙂 Solution find here
it sounds like even though its a fresh install of WP 3.1.2 that you are also using an existing theme that is using a deprecated function (you havent said so but im presuming), if so paste this into your themes functions.php file (if your theme doesnt have one just create one and save it in … Read more
Simply use the @ operator in front of a function to suppress an error message/notice/whatever. Fun as it is: Even the image_resize() function uses it for chmod. 🙂
If you followed the install instructions with that theme, one of the steps was to add the WP e-Commerce plugin and activate it. wpsc_cart_item_count is a function of that plugin, so it is likely not currently activated.
The cause of the inconsitent behavior on the hosts has its roots in the different PHP versions. If you check the PHP manual for the empty() language construct, you can see in the changelog: 5.5.0 empty() now supports expressions, rather than only variables. So it is only since PHP 5.5 that it is possible to … Read more
In my case the cause was plugin All In One WP Security an its “Basic Firewall Settings”. The above firewall features are applied via your .htaccess file and one if these features is “Limit file upload size (10MB).” So to make upload of files larger then 10 MB working again you can do following: 1) … Read more
I had this same error. For me, this happened because I moved the datadir of my database. On centos – the default location of the datadir is /var/lib/mysql – and the default loc of the socket file is /var/lib/mysql/mysql.sock I moved the datadir to /datadir/mysql. The Mysql db server started fine and the ‘mysql’ command … Read more