How to create a widget with a populated dropdown?

I finally got the widget built. I hope this will help another newbie. <?php /* * Plugin Name: Events Widget Description: This widget allows the user to select an Event name. Version: 0.5 Author: Dan Statham */ function gdd_Events_load_widgets() { write_log(‘gdd _Events_load_widgets’); }// gdd_Events_load_widgets // Register the widget function my_register_events_widget() { register_widget( ‘gdd_Events_load_widgets’ ); } … Read more

How to pass bloginfo(url) in a jquery

You should be able to use a relative URL. window.location.replace(“/contact-us”); If that code was run on any page on example.com, it would redirect to example.com/contact-us

Customize the “Available for back order” text for specific variation

I did it. The “stock.available-on-backorder.step-1” is the css class of the availability text ( Available- made to measure ). <?php add_action( ‘woocommerce_before_add_to_cart_quantity’, ‘made_to_measure’ ); function made_to_measure() { global $product; if ( $product->is_type(‘variable’) ) { ?> <script> jQuery(document).ready(function($) { $(‘input.variation_id’).change( function(){ if( ” != $(‘input.variation_id’).val() ) { //var var_id = $(‘input.variation_id’).val(); var pa_size = jQuery( “#pa_size” … Read more

Edit a function to take different actions based on user role

wp_update_post() ends up using wp_insert_post(), which has wp_insert_post_data inside it. The filter “Filters slashed post data just before it is inserted into the database.” I think that would be suitable moment to add the custom logic you described as publishorpend method doesn’t seem to have other filters available in it. You could perhaps do something … Read more