Widget checkbox array empty on update function

I suspect this is mostly happening because down towards the bottom, you’ve got an input that’s not using $this->get_field_name() (the first of the two checkbox inputs). Try using $this->get_field_name() as you did in the “then” clause of that section of code and it should be OK. Not much else wrong that I can see.

Pass widget variable to external function

Firstly, you will need your code to store the exclude value somewhere. Since you don’t want to use a global ( rightly so ), you have few remaining options: a class the class you already have a closure standard APIs Option 1 a new object/class Here we create an object, that holds the category you’re … Read more

can’t edit widgets after moving from subfolder to root

If anyone will ever have these issues, here are some solutions: deactivate WP UI plugin – but if you still want to use it, try to modify wp_register_script( ‘wpui-script-before’, site_url( ‘?wpui-script=before’ ), ___something___ ); to wp_register_script( ‘wpui-script-before’, home_url( ‘?wpui-script=before’ ), _____something_____ ); in: /wp-content/plugins/wp-ui/wp-ui.php /wp-content/plugins/wp-ui/admin/wpUI-options.php /wp-content/plugins/wp-ui/inc/widgets.php

widget exclude post by custom field

The meta_query parameter in WP_Query allows you to query posts that don’t have a certain custom field. Furthermore, you can check for multiple custom fields. With two queries in meta_query, you can fetch all posts that either don’t have a custom field, or have it set to 0: ‘meta_query’ => array( ‘relation’ => ‘OR’, array( … Read more