Answer the question
In order to leave comments, you need to log in
How to change default worpdress widgets?
Hello. It is necessary to display arbitrary fields in standard WP widgets (for example, a text widget) that will be added from the admin panel. For example, the class field, which allows you to set your own class for the output text. How to do it? After all, standard widgets are stored in system files and everything will be erased when updating.
Answer the question
In order to leave comments, you need to log in
Hello. You can copy the widget to your plugin and replace it with the standard one, as, for example, Custom Meta Widget
does .
function customMetaWidget_swap() {
unregister_widget( 'WP_Widget_Meta' );
register_widget( 'customMetaWidget' );
} add_action( 'widgets_init', 'customMetaWidget_swap' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question