WordPress.org

Ready to get started?Download WordPress

Forums

wp-includes/widgets.php "widget_many" example doesn't work (4 posts)

  1. palamedes
    Member
    Posted 6 years ago #

    Howdy guys.

    I am in the process of creating my own custom theme and would like to create a couple of custom widgets to go along with it.

    Widgets are easy to create, but I came across a need for a "many widget" which you provide an example for in wp-includes/widgets.php

    This code doesn't work -- after days of trying to get my widget to work following your example I finally just commented out my code entirely and cut/pasted your 'many_widget' example into my functions.php file.

    The "Many" control shows up and you can add items to it, however upon reloading the page anything you added is gone. (Which is exactly what I was experiencing with my attempt earlier). The data is in the database in the wp_options table, but its not being adhered to.

    I have no solution for fixing this, but its clearly broken at this time.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Yeah, that example sucks. Somebody should have double checked it.

    Look at the text widget or my PHP Code widget instead. They're subtlety different, and they work.

  3. palamedes
    Member
    Posted 6 years ago #

    Yep.. much better.. Thanks otto.

  4. litemotiv
    Member
    Posted 6 years ago #

    the text widget is barely readably itself, it's really programming-101 to not name functions, variables and id's 'text'.... dramatic stuff, whoever made this should be....taught.

Topic Closed

This topic has been closed to new replies.

About this Topic