Include custom post type custom taxonomies in the Categories widget

I wanted to see if this was possible, but I want to include custom taxonomy categories of custom message type in the WordPress Categories widget.

I know there is a filter as shown below:

add_filter('widget_categories_args', function() {
    $params('post_type') = array('post', 'recipe');
    return $params;
  1. My taxonomy is called recipe-categories inside wp_term_taxonomy and I want to be able to insert all the categories in the Categories widget.

  2. recipe is my type of personalized message.

  3. The URL string is taxonomy=recipe-categories&post_type=recipe

Here are all the categories I have:

enter description of image here

All I get is post categories and not my recipe categories as shown below:

enter description of image here

Alternative taxonomy term to parent widget

I have a huge hierarchical vocabulary of terms and adding a new child to a specific term can be difficult using the default multivalued picklist widget.

Can I use an AutoComplete widget or – better – an entity browser instead?

wp query – Pagination unique to a widget

I have paging problems. It is a widget. Each widget has a unique identifier. Let's say I have two pagination widgets. If I click on page 2 of widget 2, it will work, but it will also change the pagination of the first.

$paged_id = $this->get_id();
$paged_query_var = 'paged'.$paged_id;
$paged_bottom = (get_query_var($paged_query_var)) ? absint(get_query_var($paged_query_var)) : 1;
$paged_bottom_args = array(
'format' => '?paged'.$paged_id.'=%#%',
'current' => intval($paged_bottom),
'total' => intval($query->max_num_pages),
'mid_size' => $pagination_midsize,
'prev_text' => '',
'next_text' => '',
echo paginate_links($paged_bottom_args);

this is what i tried but it doesn't work because get_query_var will not have a variable in it. This is something dynamic, so I am not able to set the variable for get_query_var using the filter.

Is there a way?

Customization of Thingsboard telemetry Cannot convert using the post-processing feature in the widget

Widget cards

data post-processing functions

The right map widget in this image is the original telemetry and I want to convert the on / off output like the left side of the map widget, and it looks easy on the right. But after several attempts of my codes, nothing works well because the output should be as if it is true = On, false = Off. But at the moment, it only displays one output which is true = on and ignores the other conditions. Maybe someone had these problems and wanted to help me understand what was going on here.

Android clock and weather widget

I accidentally uninstalled my weather clock widget and would love to get it back. HELP ME, PLEASE

android – Update floating widget settings

Hello, I make a floating widget which allows me to see the speed at which I download or upload a file on the Internet, for that I consist of a service which launches my floating widget with 2 TextView, upload and download and I have need to update these values ​​for Then I show the code.

public class NetworkService extends Service {

private WindowManager windowManager;
private View chatHead;
WindowManager.LayoutParams params;
private TextView up,down;

public void onCreate() {

    //Obtenemos la instancia de WindowsManager
    windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);

    //Instanciamos el objeto que queremos adjuntar a WindowsManager
    chatHead =  LayoutInflater.from(this).inflate(R.layout.servicio_flotante,null,false);

    //Aplicamos parametros que necesitemos
    params = new WindowManager.LayoutParams(

    //Posicion donde queremos que se acople
    params.gravity = Gravity.TOP | Gravity.LEFT;
    params.x = 0;
    params.y = 100;

    //TouchListener para mover el elemento por la pantalla
    chatHead.setOnTouchListener(new View.OnTouchListener() {
        private int initialX;
        private int initialY;
        private float initialTouchX;
        private float initialTouchY;

        public boolean onTouch(View v, MotionEvent event) {
            switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    initialX = params.x;
                    initialY = params.y;
                    initialTouchX = event.getRawX();
                    initialTouchY = event.getRawY();
                    return true;
                case MotionEvent.ACTION_UP:
                    return true;
                case MotionEvent.ACTION_MOVE:
                    params.x = initialX
                            + (int) (event.getRawX() - initialTouchX);
                    params.y = initialY
                            + (int) (event.getRawY() - initialTouchY);
                    windowManager.updateViewLayout(chatHead, params);
                    return true;
            return false;

    //Acoplamos el elemento a la pantalla
    windowManager.addView(chatHead, params);


public void onDestroy() {
    if (chatHead != null)

public IBinder onBind(Intent intent) {
    // TODO Auto-generated method stub
    return null;

In R.layout.flotante_service, there are 2 textView and I want this to be updated by receiving the upSpeed ​​and downSpeed ​​values ​​from this code snippet

ConnectivityManager connectivityManager = (ConnectivityManager) getBaseContext().getSystemService( Context.CONNECTIVITY_SERVICE);
    NetworkInfo networkInfo= connectivityManager.getActiveNetworkInfo();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
        NetworkCapabilities networkCapabilities = connectivityManager.getNetworkCapabilities(connectivityManager.getActiveNetwork());
        int upSpeed = networkCapabilities.getLinkUpstreamBandwidthKbps();
        int downSpeed = networkCapabilities.getLinkDownstreamBandwidthKbps();


I don't know how to update these values

magento2 – How to rewrite the jquery code in the jquery ui widget

How to redo this code in the ui jquery widget?

There is such a jquery code. When you select an item using the check box, the item is cloned and added to another block.
Tell me how to rewrite it in the jquery ui widget since magento uses them to inject js code. Even if you have suggestions for improving the code, I would love to read your ideas :]

I will also be happy to help any such examples, thanks

example on codepen:

magento2 – How to add a custom button to the product widget

Battery exchange network

The Stack Exchange network includes 175 question and answer communities, including Stack Overflow, the largest and most reliable online community for developers who want to learn, share knowledge and develop their careers.

Visit Stack Exchange

magento2 – Magento 2 How to add a dynamic line field to a custom widget

I need to add a dynamic line field to my custom widget, which should have three columns: title (text field), color (selection field), url (text field). There should also be an add button and delete buttons for each row. If possible, it would be nice to be able to swap lines. I guess in widget.hml I have to declare a block type and specify a class, but I don't understand what the code for that class should look like.

php – add a custom metabox to the custom widget in the media library

I am implementing a custom widget to create a logo slider. The initial code works fine, but when I added a metabox to the attachment screen to allow the user to add an external link to the images, I did problems.
What I want to do is add the metabox, save its value and when the widget is loaded on the front end, find the link that the user added for each image. The images are not attached to any message, and for now I can see the new metabox but it can only be edited if the user clicks on the edit link of each image in the media library , I prefer to see the box on the main selection screen of the media gallery. I also cannot get the value of the field, I think that in the code, the identifiers of the images are not loaded.

public function initMetabox()
      __('Link image to url'),
      array($this, 'renderMetabox'),

  public function renderMetabox( $post )
    $url = get_post_meta( $post->ID, '_image_link_url', true );
    ID, '_image_link_url', true );


The foreach loop for image links will produce an error Invalid argument supplied... and the variable $ post-> ID is not available. Do not hesitate to send us your suggestions