Changeset 50996 for trunk/src/wp-includes/widgets.php
- Timestamp:
- 05/25/2021 08:38:04 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets.php
r50995 r50996 1802 1802 register_widget( 'WP_Widget_Block' ); 1803 1803 1804 add_theme_support( 'widgets-block-editor' ); 1805 1804 1806 /** 1805 1807 * Fires after all default WordPress widgets have been registered. … … 1808 1810 */ 1809 1811 do_action( 'widgets_init' ); 1812 } 1813 1814 /** 1815 * Whether or not to use the block editor to manage widgets. Defaults to true 1816 * unless a theme has removed support for widgets-block-editor or a plugin has 1817 * filtered the return value of this function. 1818 * 1819 * @since 5.8.0 1820 * 1821 * @return boolean Whether or not to use the block editor to manage widgets. 1822 */ 1823 function wp_use_widgets_block_editor() { 1824 /** 1825 * Filters whether or not to use the block editor to manage widgets. 1826 * 1827 * @param boolean $use_widgets_block_editor Whether or not to use the block editor to manage widgets. 1828 */ 1829 return apply_filters( 1830 'use_widgets_block_editor', 1831 get_theme_support( 'widgets-block-editor' ) 1832 ); 1810 1833 } 1811 1834 … … 1972 1995 return ob_get_clean(); 1973 1996 } 1997 1998 // Needed until src/blocks/legacy-widget/index.php in @wordpress/block-library 1999 // is updated to use the 'wp_' functions. 2000 function gutenberg_find_widgets_sidebar( $widget_id ) { 2001 return wp_find_widgets_sidebar( $widget_id ); 2002 } 2003 function gutenberg_render_widget( $widget_id, $sidebar_id ) { 2004 return wp_render_widget( $widget_id, $sidebar_id ); 2005 } 2006 function gutenberg_get_widget_object( $id_base ) { 2007 global $wp_widget_factory; 2008 return $wp_widget_factory->get_widget_object( $id_base ); 2009 }
Note: See TracChangeset
for help on using the changeset viewer.