How to changing the widget ID
-
Hi again, @anmari
Hope you are well.
I am returning to this topic (https://wordpress.org/support/topic/changing-the-widget-id/) so I can make a test site and figure out how to safely change a widget ID.
I am still unable to find the option ‘widget-text’ (as shown in your screenshot). May you provide exactly how to get there so I can try it.
Thank you
The page I need help with: [log in to see the link]
-
Ah, I got it?
SELECT * FROM
wp_optionsWHEREoption_name= ‘widget_text’and edit it from there?
I finally did what you said, and found it does lose widgets.
Okay, some development:
On a test site, I removed all widgets and cleaned out the widget_text data in phpMyadmin.
I found that it ALWAYS starts at [do_widget id=text-2]
—–
For example: AAAA = starts at ID 2, BBBB = starts at ID 3, CCCC = starts at ID 4, DDDD = starts at ID 5.And this is what appears in the Database:
a:5:{i:2;a:4:{s:5:”title”;s:4:”AAAA”;s:4:”text”;s:0:””;s:6:”filter”;b:1;s:6:”visual”;b:1;}i:3;a:4:{s:5:”title”;s:4:”BBBB”;s:4:”text”;s:0:””;s:6:”filter”;b:1;s:6:”visual”;b:1;}i:4;a:4:{s:5:”title”;s:4:”CCCC”;s:4:”text”;s:0:””;s:6:”filter”;b:1;s:6:”visual”;b:1;}i:5;a:4:{s:5:”title”;s:4:”DDDD”;s:4:”text”;s:0:””;s:6:”filter”;b:1;s:6:”visual”;b:1;}s:12:”_multiwidget”;i:1;}
This is so interesting,
So, I made them all start at 1 (instead of 2 as you see from the database data)
and this happened:
BBBB = starts at ID 2, CCCC = starts at ID 3, DDDD = starts at ID 4.
—
It disallows [do_widget id=text-1] to exist. and MUST start from 2.I started making widgets that I have NEVER used before and they all start at 2 as well.
So I guess widget ids that start at 1 never do?
I would really value your view on all this @anmari , thank you for this.
Thanks
Kristian,
why do you want to change the widget id? It feels like you are battling against something that it is not necessary to struggle with?AS advised here you can do a search & replace if that is still the problem you have ? https://wordpress.org/support/topic/changing-the-widget-id/
I cannot change the way wordpress works. My various suggestions in the original post stand.
The topic ‘How to changing the widget ID’ is closed to new replies.