entities – Does the conflicting entity view widget conflict with the time field?

I'm trying to configure a content type that requires both an Entity Reference Views widget and also Time Fields (https://www.drupal.org/project/timefield), but the ERVW parameter does not work in the content. type when there is also a time field. I have setup and tested the ERVW software and it is working properly in several types of content for the site. However, once a Time field is added to the content type, the View widget does not load when you click "Add Items." Any help very appreciated! Website on drupal 7

How to customize a widget class in the Style.css file?

I am a beginner here. I could customize a feed via widget / RSS plugins or additional CSS. But while I'm adding directly into style.cssit did not work.
I have read a similar question
"Custom CSS for a particular text / HTML widget in WordPress."
and WordPress feed reference

Finally, I decided to follow the steps outlined in the wire icons

Custom html


style.css

.feed-list {
margin: 0 0 15px 15px;
padding: 0;
type of list style: none;
}

.feed-list li {
margin: 0 0 10px 0;
padding: 0;
type of list style: none;
}

.feed-list li a {
filling: 0 0 0 19px;
background: url ("https://lujihood.com/wp-content/themes/independent-publisher-2-wpcom/feed-icon-14x14.png") no-repeat 0 50%;
type of list style: none;
}

The mailing list icon did not appear to the left of the texts. Inspect has shown that class = "widget widget_text". Do I have to create a course or something?

How to use widget options as a shortcode?

I have the function that converts widgets options into short code arguments.

The MOD_Widget abstract class extends WP_Widget {

    [...]
    [...]

    

    

    

    public function params_to_shortcode ($ params) {
$ sc_attrs = array ();
foreach ($ params as $ key => $ attr) {
if (is_array ($ attr)) {
$ attr = implode (& # 39 ;, & # 39 ;, $ attr);
}

$ sc_attrs[] = "{$ key} = " ". esc_attr ($ attr)." # ;;
}

return $ sc_attrs;
}

}

widget:

the MOD_Widget_Base class extends MOD_Widget {

    [...]
    [...]

    

    

    

    public function widget ($ args, $ instance) {

$ widget_tag = str_replace (-, -, $ this-> widget_id);
$ shortcode = do_shortcode (
& # 39;[' . $widget_tag . ' ' . implode( ' ', $this->params_to_shortcode( $instance ) ) . '/]& # 39;
)

echo $ args['before_widget'];

echo & # 39;
& # 39 ;;
echo $ shortcode;
echo & # 39;

& # 39 ;;

echo $ shortcode;

echo $ args['after_widget'];
}

}

When I add my widget in the sidebar, it works well.
Exit: [mod_widget_base base_title="" posts="10" thumbnail="0"/]

When I use my widget in the Elementor page builder, I have only one shortcode tag with no arguments: [mod_widget_base /]

How to use this solution in the Elementor page builder?

Convert PHP / Javascript to Widget – WordPress Stack Exchange Development

I will start by saying that I am a beginner in WordPress development and have never had to use AJAX or JQuery, which, if what I read is correct, should be accomplished with. The calendar works perfectly outside WordPress, but I can not convert it into a widget.

The calendar goes well from one month to the next, but when I click on the previous button next month, it loads a copy of the page where the widget should be. So I basically need 2 copies of the page. Any help is appreciated. Here is the code.

events.php

/ *
Plugin Name: Intranet Calendar Plugin Test
Description: Event plug-in for intranet Cheshire Medical Center
Version: 1.0.0
Author: Mike Dunham at Cheshire Medical Center
License: GPLv2 or later
Text field: Cheshire Medical Center
* /

the Calendar_Widget class extends WP_Widget {

public service __construct () {
$ widget_options = array (
& # 39; classname & # 39; => & # 39; calendar_widget & # 39;
& # 39; description & # 39; => & # 39; This is an event widget & # 39;
)
parent :: __ construct ('calendar_widget', 'Calendar Widget', $ widget_options);
}


public function widget ($ args, $ instance) {
$ title = apply_filters (& # 39; widget_title & # 39; Test Calendar & # 39;);
echo $ args['before_widget'] . $ args['before_title'] . $ title. $ args['after_title'];

wp_enqueue_style (& # 39; calendar & # 39 ;, plugins_url (). & ord; /calendar/calendar.css' false, & quot; 1.1 & # 39;, & quot; all & # 39;);
wp_enqueue_script (& # 39; calendar & # 39 ;, plugins_url (). /calendar/calendar.js&#39 ;, array (& # 39; jquery & # 39;), null, true);

if (isset ($ _GET["newmonth"])) {
$ month = $ _GET["newmonth"];
$ month = $ month + 1;
$ day = 1;
$ year = $ _GET["newyear"];
$ newdate = mktime (0,0,0, $ month, $ day, $ year);
$ displaymonth = date ("F", $ newdate);
$ displayyear = date ("Y", $ newdate);
$ linkmonth = date ("m", $ newdate);
$ linkyear = date ("Y", $ newdate);
$ current = date ("j");
$ totaldays = date ("t", $ newdate);
} other {
$ displaymonth = date ("F");
$ displayyear = date ("Y");
$ linkmonth = date ("m");
$ day = 1;
$ linkyear = date ("Y");
$ current = date ("j");
$ totaldays = date ("t");
}
?>
        
<? php $ first = date ("w", mktime (0,0,0, $ linkmonth, $ day, $ linkyear)); $ ctr = 1; $ ctrcells = 0; for ($ i = 0; $ i <$ first; $ i ++) { echo ""; } for ($ i = $ prime; $ i <= 6; $ i ++) { if ($ ctr == $ current) { echo ""; }other{ echo ""; } $ ctr ++; } echo ""; while ($ ctr <= $ totaldays) { if ($ ctr == $ current) { echo ""; }other{ echo ""; } $ ctrcells ++; if ($ ctrcells == 7) { echo ""; $ ctrcells = 0; } $ ctr ++; } if ($ ctrcells <> 0) { for ($ i = $ ctrcells; $ i <7; $ i ++) { echo ""; } } ?>
Sun Mon Tue sea Thu Fri sat
$ ctr$ ctr
$ ctr$ ctr

<label for = "get_field_id (& # 39;) & # 39; ?> "> Title: <type of entry = "text" id = "get_field_id (& # 39;) & # 39; ?> "name ="get_field_name (& # 39; title & # 39;); ?> "value =""/>

<? php } public function updatecalendar ($ new_instance, $ old_instance) { $ instance = $ old_instance; $ instance[ 'title' ] = strip_tags ($ new_instance[ 'title' ] ) return $ instance; } } function register_calendar_widget () { register_widget (& # 39; Calendar_Widget & # 39;); } add_action (& # 39; widgets_init & # 39; register_calendar_widget & # 39;); register_activation_hook (__FILE__, & # 39; activate_cheshire_calendar_plugin & # 39;); // register_deactivation_hook (__FILE__, deactivate_staff_directory_plugin & # 39;); register_uninstall_hook (__ FILE__, & # 39; uninstall_cheshire_calendar_plugin & # 39;); function activate_cheshire_calendar_plugin () { } function uninstall_cheshire_calendar_plugin () { } function calendar_admin_menu_option () { add_menu_page ("CMC Calendar Test", "CMC Calendar Test", manage_options, calendar_admin_menu, calendar_scripts_page & # 39; 39,, & gt; 200); // add_submenu_page (& # 39; directory_admin_menu & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & # 39 ;, & # 39; 39; directory_address_location & # 39; & # 39; directory_location_page_location & # 39;); } add_action ('admin_menu', 'calendar_admin_menu_option'); function calendar_scripts_page () { $ wpdb global; echo "

CMC Calendar Test Module

"; }

calendar.js

document.getElementById ("prev"). addEventListener (& # 39; click & # 39 ;, getPrevmonth);
document.getElementById (& # 39; next & # 39;). addEventListener ('click', getNextmonth);

getPrevmonth (e) {function
e.preventDefault ();

var currentmonth = document.getElementById (& # 39; currentmonth & # 39;). value;
var currentyear = document.getElementById (& # 39; currentyear & # 39;). value;

if (current month) {
if (currentmonth == 0) {
var newmonth = 11;
var newyear = currentyear-1;
} other {
var newmonth = Number (currentmonth) - 1;
var newyear = currentyear;
}
} other {
var date = new Date ();
var month = date.getMonth ();
var year = date.getFullYear ();

if (months == 0) {
var newmonth = 11;
var newyear = year-1;
} other {
var newmonth = month - 1;
var new year = year;
}
}

var newcal = new XMLHttpRequest ();
newcal.open ("GET", "newmonth =" + newmonth + & # 39; & newyear = + newyear, true);

newcal.onload = function () {
document.getElementById (& # 39; calendariv & # 39;). innerHTML = this.responseText;
document.getElementById (& # 39; currentmonth & # 39;). value = newmonth;
document.getElementById (& # 39; currentyear & # 39;). value = newyear;
document.getElementById ("prev"). addEventListener (& # 39; click & # 39 ;, getPrevmonth);
document.getElementById (& # 39; next & # 39;). addEventListener ('click', getNextmonth);
}

newcal.send ();
}

function getNextmonth (e) {
e.preventDefault ();

var currentmonth = document.getElementById (& # 39; currentmonth & # 39;). value;
var currentyear = document.getElementById (& # 39; currentyear & # 39;). value;

if (current month) {
if (currentmonth == 11) {
var newmonth = 0;
var newyear = Number (currentyear) + 1;
} other {
var newmonth = Number (currentmonth) + 1;
var newyear = currentyear;
}
} other {
var date = new Date ();
var month = date.getMonth ();
var year = date.getFullYear ();

if (month == 11) {
var newmonth = 0;
var new year = year + 1;
} other {
var newmonth = month + 1;
var new year = year;
}
}
var newcal = new XMLHttpRequest ();
newcal.open ("GET", "newmonth =" + newmonth + & # 39; & newyear = + newyear, true);

newcal.onload = function () {
document.getElementById (& # 39; calendariv & # 39;). innerHTML = this.responseText;
document.getElementById (& # 39; currentmonth & # 39;). value = newmonth;
document.getElementById (& # 39; currentyear & # 39;). value = newyear;
document.getElementById ("prev"). addEventListener (& # 39; click & # 39 ;, getPrevmonth);
document.getElementById (& # 39; next & # 39;). addEventListener ('click', getNextmonth);
}

newcal.send ();
}

calendar.css

#calendar {

}

#mainhead {
font size: 40px;
text-align: center;
}

#prevmonth {
font size: 40px;
text-align: left;
}

#next month {
font size: 40px;
text-align: right;
}

#on your mind {
font size: 30px;
}

.bouton {
background color: white;
border: none;
black color;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font size: 30px;
margin: 4px 2px;
cursor: pointer;
}

.nil {
background color: # f2d7d5;
}

.now today
font size: 20px;
text-align: center;
background color: # 85c1e9;
}

today: hovering {
background color: # cd6155;
}

.day {
font size: 20px;
text-align: center;
}

.day: hover {
background color: # cd6155;
}

a {
text-decoration: none;
black color;
}

magento2 – Adds a static block (widget) before breadcrumbs

I'm using Magento 2.3.0, and I'm trying to add a block before the tasks without bread, without any fill or margin.
I've created a block from the backend, then my widget using that block, and then placed it on "Catalog Category", as I only want it on the category pages. I place the block / widget just after the Ariane thread, and it also has the padding of the block class, which I do not want, I would like it to be at 100% of width.

magento2 – Option to reset the Magento 2 widget

I am working on a custom widget that allows to add multiple CMS blocks instead of one.

This works well, however, when blocks have been selected, they can not be deleted (they can only be changed).

Is it possible to add a "reset / delete widget block" option?

enter the description of the image here

How to save widget fields generated from a table?

I've created a simple abstract class of php widgets that can generate a form with fields from a table. How to save fields

Code:

public function save_fields ($ new_instance, $ old_instance, $ parent_container = null) {

// Vars
$ instance = $ old_instance;
$ widget_fields = $ this-> fields;
if (isset ($ parent_container)) {
$ widget_fields = $ widget_fields[ $parent_container ]['sub_fields'];
}

// Loop the fields and get the values ​​to save.
foreach ($ widget_fields as $ key => $ setting) {
$ setting_type = isset ($ setting['type'] )? $ setting['type'] : & # 39;

// Format the value according to the type of fields.
switch ($ setting_type) {
case 'group':
$ this-> save_fields ($ new_instance, $ old_instance, $ key);
Pause;
case "text":
$ instance[ $key ] = isset ($ new_instance[ $key ] )? sanitize_text_field ($ new_instance[ $key ] ): (isset (setting $['default_value'] )? $ setting['default_value'] : & # 39;);
Pause;
case "textarea"
$ instance[ $key ] = wp_kses_post ($ new_instance[ $key ] )
Pause;
default:
$ instance[ $key ] = isset ($ new_instance[ $key ] )? sanitize_text_field ($ new_instance[ $key ] ): (isset (setting $['default_value'] )? $ setting['default_value'] : & # 39;);
Pause;
}

}

return $ instance;
}

/ **
* Manages the update settings for the current widget instance.
* /
public service update ($ new_instance, $ old_instance) {

$ instance = $ old_instance;

if (empty ($ this-> fields)) {
return $ instance;
}

$ this-> save_fields ($ new_instance, $ old_instance);

return $ instance;
}

Table with fields

public service __construct () {
$ this-> widget_cssclass = single-w simple-w_widget_test & # 39 ;;
$ this-> widget_description = __ (& # 39; description of the widget. & # 39; simple-w & # 39;);
$ this-> widget_id = single-w-widget-test & # 39 ;;
$ this-> widget_name = __ (Simple-W - Test & # 39; simple-w & # 39;)
$ this-> fields = array (

& # 39; base_title & # 39; => array (
& # 39; Label & # 39; => __ (& # 39; Base title & # 39 ;, & quot; simple-w & # 39;),
& # 39; like & # 39; => & # 39; text & # 39;
& # 39; class & # 39; => & # 39;
& # 39; default_value & # 39; => & # 39; Test & # 39;
)

// first group
& # 39; group_heading & # 39; => array (
& # 39; Label & # 39; => __ (& # 39; Heading & # 39 ;, & quot; simple-w & # 39;),
& # 39; like & # 39; => 'Group',
& # 39; sub_fields & # 39; => array (
& # 39; HEADING_TITLE & # 39; => table (
& # 39; Label & # 39; => __ (& # 39;) First group title, & # 39; simple-w & # 39;),
& # 39; like & # 39; => & # 39; text & # 39;
& # 39; class & # 39; => & # 39;
& # 39; default_value & # 39; => & # 39;
)
)
)

// second group
& # 39; group_sidebar & # 39; => array (
& # 39; Label & # 39; => __ (& # 39; second group title & # 39 ;, & quot; simple-w & # 39;),
& # 39; like & # 39; => 'Group',
& # 39; sub_fields & # 39; => array (
& # 39; sidebar_title & # 39; => array (
& # 39; Label & # 39; => __ (& # 39; second group title & # 39 ;, & quot; simple-w & # 39;),
& # 39; like & # 39; => & # 39; text & # 39;
& # 39; class & # 39; => & # 39;
& # 39; default_value & # 39; => & # 39;
)
)
)
)

parent :: __ construct ();
}

How to get the total gross avenue for the current month in the woocommerce dashboard status widget

I need to show the gross sales of the current month in the woocommerce status widget in the dashboard of the administrator. Currently, it shows the amount of net sales that I have to change by making gross sales.

Magento 2 Get widget settings as a table

Is there a way to get all the widget parameters in an array instead of loading the data of a specific widget parameter as below?

$ this-> getData (& # 39; widget_parameter_1 & # 39;);

So, something like:

$ currentwidgetObject-> getParameters ();

The widget & Blog Subscription & # 39; Jetpack does not add e-mails to

I'm trying to use the Jetpack widget "Blog Subscriptions", but the emails sent with this widget are not added to the list of subscribers. Verification emails are not sent to subscribers either. How can I solve this problem?

Note: I have correctly set up an email address to use with wordpress and the installation is able to send emails. The problem comes from the subscription of users to the mailing list.