A
A
Anton2017-03-04 21:15:05
PHP
Anton, 2017-03-04 21:15:05

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

1 answer(s)
D
Denis Yanchevsky, 2017-03-05
@deniscopro

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' );

Or find a ready-made plugin, perhaps someone has already implemented what you need
https://www.google.ru/webhp?sourceid=chrome-instan...
https://ru.wordpress.org/plugins/tags/ text-widget

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question