How can I get the number (count) of, let's say, text widgets from a sidebar?
for eg. if I drop 4 text widgets in the sidebar, I want to get this number somehow from another widget
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityCall wp_get_sidebars_widgets(), and loop through each sidebar. Off the top of my head, text widgets have an ID like widget_text-$i.
widget_
prefix though, so text widgets have a name like text-1
, text-2
and so on..