Changing WP_MEMORY_LIMIT doesn’t affect actual memory limit

So you’ve tried setting the WP_MEMORY_LIMIT variable in the wp-config.php file, but have you tried .user.ini or .php.ini? Create one of those files (yes, with the period in front) and then use: memory_limit=30M Or whatever value you’re looking for. By default, WordPress is set to 40mb for a single installation, and 64mb for a multisite … Read more

WooCommerce: write featured image dimensions to custom fields in product’

The key here is to use the save_post hook and have it only run the code when the post type is product (or whatever your product post type is). Here’s the code — I made the assumption that you want the full size of the featured image: add_action( ‘save_post’, ‘save_product_featured_image_dimensions’ ); function save_product_featured_image_dimensions( $post_id ) { … Read more

How to get a database field value from a WordPress table? [closed]

In the first two cases, there’s an array wrapping the object that you have to attend to first. e.g. this should work: $status = $user[0]->status; As a sidenote: In the last case, json_encode() doesn’t, as the name might suggest, turn data into an object with properties that you can access — it turns it into a … Read more