I copied the class definition and register_widget( 'My_Widget' );
to my theme’s functions.php file & it did show My Widget under Appearance > Widgets
. So please place this code directly in your theme’s functions.php file. It is not recommended to edit anything in wp-includes directory.
Related Posts:
- How to load Widget javascript + css files only if used?
- Adding iframe Content to Sidebar Widget
- Storing custom dashboard widget options in wordpress
- $post>ID displays wrong post ID
- Video Embed in Sidebar Widget with Links to Others in Category
- Shortcode from a widget is wrapped in unwanted element
- How can I whitelist only specific shortcodes for processing in text widgets?
- Bookshelf plugin and/or widget [closed]
- How to update widget from widget() function?
- Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?
- Manual display of widget
- Add a banner to the Dashboard
- Customized widget area – how to override or filter class xoxo?
- How to access widget data from outside widget?
- Unable to get Alert function to consistently work with backend widget with latest WP
- How to add a description to Widgets?
- Widget options get
- add_page_menu to make shortcut to widgets
- Insert custom content before widget title/after widget opening tag
- How do I stop a widget from displaying on mobile site?
- cannot drag and drop widgets since wordpress 3.2.1
- Show widget when not using SSL
- How/where is the global variable $wp_registered_widgets filled?
- Converting a WordPress widget to a block
- Color Picker Showing Twice When Widget Added to Sidebar
- How can I use AJAX to save/update a widget form?
- Display assigned terms with link
- Hide all Dashboard Widgets (not remove)
- Widget modifications in a child theme
- How to get “Widget Logic” plugin’s input value in a custom widget code (to display on the Widget admin page)
- Extending WP_Widget throws error when Monster Widget used
- Making footer widgets responsive
- Custom html widget with a Joomla-style assigment
- Form link throwing website to main language
- Conditional Tags Based on Previously Viewed Posts
- Make page jumps in widget
- Query in query for Widget
- How to display first post thumbnail as a background image of a widget?
- Create widget in dashboard displaying a custom user field?
- Limit number of widgets in widget area
- How to create pagination for homepage with widgetized area?
- Hooking action once but called twice
- How to update the widget form when the image is selected?
- How can I add an author-box below a post?
- How to overload the update() of existings widgets?
- Help me out with this Undefined index ?
- Dynamic Sidebar and XHTML Validity?
- Displaying a WordPress widget by name
- Remove “Content” and “Discussion” from Right Now Dashboard Widget
- wordpress widgets screen disappeared
- Proper approach to moving complete site from one domain to another AND preserve widgets
- Why custom widget won’t appear in Block editor (Gutenberg)?
- Can the qTranslateX-Plugin translate non-article text? [closed]
- Custom widget is not appearing in the admin area
- A/B test options at the widget level [closed]
- Static image for embedded YouTube video instead of blank player?
- event organiser not loading in main content area
- Any available action to add content before and after sidebar?
- Creating a widget that displays the content of a page
- How to place my g+ or fb plugin at the bottom of post or page?
- WP 3.3 RC1 new switch_theme() method foobars sidebars
- How to Catch Last Widget box From Same Widget Area?
- WordPress widget value not save?
- Countdown Widget
- recent comments filter by author, page, category
- Display Most Recent Post Widget Title On Page
- How do I get my custom widget to show on live site?
- Accessing WooCommerce product categories before initialising widget areas
- Create a new recent post widget
- How do I add footer widgets to the StudioPress Monochrome Pro theme?
- How to prevent Widget from echoing to wrong position in DOM
- wp_enqueue_media(); in multiple widgets
- Add Control in Widgets Sub-Panel in Customizer
- How to get sidebar widgets in leftsidebar template
- How to get number of posts in same category as current post?
- Add Social Media icon widget to customizer
- Make a widget to my footer
- How to change text of a widget depend on condition?
- Always show the widget title in a wordpress widget
- Custom php Widget keeps disappearing from the front end
- Display Posts by Views (Popular Posts Widget)
- Default WordPress widgets always appear
- Add space to the end on a widget
- Insert to wp_footer if widget is found in the sidebar
- Using javascript on the new widget preview / customizer page
- Show editor widgets only on pages that use a specific template?
- Conditionally enable autoplay when using oEmbed in a custom widget
- Options page for widget
- user definable sidebar per page
- List.js inside WordPress widget
- Show or hide custom menu widget in side bar conditionally
- WordPress Hide Widget If $_Session Is Active?
- Post Thumbnails on Sidebar Widgets
- Using Conditional Tags to restrict something to 1 user?
- Recent posts with different class name for each post and a scrollbar?
- Problem on register/login widgets
- Classic widgets with 5.9+?
- Widget block editor: Unable to collect checkbox values inside widget update() method
- Theme Widget Area Defaults
- How to add the “page” post type to Recent Activity widget displayed in admin?