K
K
kapost2020-05-05 21:14:50
WordPress
kapost, 2020-05-05 21:14:50

Is it possible to create a text field widget in the WordPress console?

I came across such a hook for creating a widget in the Vorodpress console. Interested in whether it is possible to create a text field by the same principle, filling in which you can display data, for example, in the footer. That is, so that you do not need to search for the necessary widgets or, for example, create additional fields, but fill them in directly from the console.

Code example:

// Registering a console widget
add_action( 'wp_dashboard_setup', 'add_dashboard_widgets' );

// Used in the hook
function add_dashboard_widgets() {
wp_add_dashboard_widget( 'my_dashboard_widget', 'Dashboard Metabox', 'my_dashboard_widget_function' );
}

// Display content
function my_dashboard_widget_function( $post, $callback_args ) {
echo 'Hello everyone! This is my first widget!';
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question