Displaying saved category checked in a plugin?

I solved my own question as follow: foreach ($categories as $cat) { $category_explode = get_the_author_meta( ‘Category’, $user->ID ); //output 4,5,16 $cat_ex = explode(‘,’,$category_explode); ?> <label> <input type=”checkbox” name=”category[]” value=”<?php echo $cat->cat_ID; ?>” <?php foreach ($cat_ex as $cat_expld) { if($cat->cat_ID == $cat_expld){echo’checked=”checked”‘;} }?> /><span> <?php echo $cat->cat_name; ?> </label> <?php } ?>

Cannot access variables within a widget

This is more of a pure PHP than WordPress. You are implicitly creating $ranNum as local variable in function scope. $Example_Widget won’t access widget instance in PHP. What you should be using is $this->ranNum, for reading and writing. That will create object’s property implicitly, but you likely should declare it explicitly in your class definition … Read more

WordPress plugin addon [closed]

You have several options: Additional Plugins Similar to how Gravity forms works, you have the base plugin which is your standard plugin, then you build additional premium plugins that integrate into it using hooks to add additional functionality Enabling functionality Your standard plugin bundles everything inside it, but disables sections of functionality until they’re turned … Read more

Woocommerce: deleted single-product.php, everything still works. How is it possible?

Themes can override WooCommerce default template pages, to customize the appearance of those pages easily. There should be a folder within your theme folder called woocommerce. WooCommerce checks for template files within that folder first. If a file doesn’t exist there, it loads it’s own template file. Edit: If you want to customize those pages, … Read more

Show widget location borders for development

If your theme is any good, no code at all will be rendered for empty widget areas, so if you want them all to show, you must populate them. There are off course browser tools that will highlight widget areas, but they will only show one at a time, while you presumably want an overview … Read more