Getting a div wrapped around two widgets
Getting a div wrapped around two widgets
Getting a div wrapped around two widgets
Actually these types of task is for plugin not for widget. Based on the value of widget instance scripts can be enqueued to footer not in head or just after body tag. Reason behind this is the instance value can be checked inside the function widget of widget class. The function widget is called when … Read more
Is there any way to parse blocks inside widget area?
Issue #1 (nested tax_query with OR relation) After going through WordPress core and WooCommerce core, it appears query_type_bag-type=or (query_type_.$attribute) query arg is only changing the value of the operator key on the individual taxonomy array for the attribute. For example: query_type_pa_color=and = operator => ‘AND’ query_type_pa_color=or = operator => ‘IN’ You can see in the … Read more
If the goal is to display the block ID so that the user can get it easily, instead try using a block editor filter to add a panel in the sidebar: From: https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/#editor-blockedit const { createHigherOrderComponent } = wp.compose; const { Fragment } = wp.element; const { InspectorControls } = wp.blockEditor; const { PanelBody } … Read more
I would do: function update($new_instance, $old_instance) { … $instance[‘show_photostream’] = $new_instance[‘show_photostream’]; return $instance; } function form($instance) { $defaults = array ( … ‘show_photostream’ => !empty( $instance[‘show_photostream’] ) ? $instance[‘show_photostream’] : false ); $instance = wp_parse_args( (array) $instance, $defaults);
I had the same problem when adding tinymce to widgets a few months ago. Add all your javascript code with enqueue script, instead of adding it in each widget instance. Here is my tinymce implementation: http://gist.github.com/600616
No further help is needed. unset($the_team[‘_multiwidget’]); worked, and was the element in the array that was showing up at the end of the call. Will have to research what that part is exactly for future reference.
It should be possible to read the global $post variable in your widget function. This will contain all information about the post (or page) displayed on the current page.
But I see no way to add a title unless using legacy widgets. Correct, legacy old style widgets have titles, normal blocks do not because they are not widgets. Note that old style widgets are actually blocks of type core/legacy-widget. Everything is a block. Has this field been removed? No, it was never there to … Read more