How to solve Woocommerce Memory Limit

You could also try toying with the max memory limit. I think it’s far more likely you are on an EIG host and throttled to a 64mb limit. Oh one more thing, it’s define( ‘WP_MEMORY_LIMIT’, ‘128M’ );

Show button only for certain Woocommerce Product Categories

You are trying to echo PHP code. Additionally you are using single and double quotes wrong. You should just fix the formatting of your echo() functions. Something like this: echo ‘<div id=”requestsample”><a class=”fancybox button” href=”#contact_form_pop”>Request a Sample</a><div class=”fancybox-hidden” style=”display: none;”><div class=”hentry” id=”contact_form_pop” style=”width: 600px; height: 500px; overflow-x: hidden”>’; echo do_shortcode( ‘[contact-form-7 id=”269″ title=”Request Sample”]’ ); … Read more

Submitting form in wordpress plugin

Reviewing wp_dropdown_users() there is apparently a ‘selected’ parameter. So in theory, you could probably pass the posted value in here. // set to the posted value, but you might be able to do this differently, depending on how you are storing the data $selected = isset($_POST[‘author’]) ? $_POST[‘author’] : false; $args = array( ‘name’ => … Read more

Plugin function inside custom plugin

You’re probably making the check too early. Make sure all plugins are loaded before trying to access the methods they provide. You can hook into plugins_loaded action to make sure all plugins are loaded before trying to use the functions they define. class My_Plugin { public static function init() { if( function_exists( ‘wp_bannerize’ ) ) … Read more

How can i force wp-admin to use 2-column dashboard layout? [closed]

This should help: function so_screen_layout_columns( $columns ) { $columns[‘dashboard’] = 2; return $columns; } add_filter( ‘screen_layout_columns’, ‘so_screen_layout_columns’ ); function so_screen_layout_dashboard() { return 2; } add_filter( ‘get_user_option_screen_layout_dashboard’, ‘so_screen_layout_dashboard’ ); On dashboard screen options it will show 1 or 2 columns, after clicking 1 column after refresh will still be 2 columns. You can change to whatever … Read more

Get all woocommerce comments/reviews

Please try this: $args = array( ‘number’ => 100, ‘status’ => ‘approve’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘product’ ); $comments = get_comments( $args ); where you can edit the number of comments to your needs. Debug: Maybe something is changing it via the pre_get_comments hook? To debug it you can check out the SQL query … Read more