How to create a dashboard widget for one user

You have to wait for wp_loaded to use get_current_user_id(). Example: add_action( ‘wp_loaded’, ‘wpse_80061_load_dashboard_widget’ ); function wpse_80061_load_dashboard_widget() { if ( 1 === get_current_user_id() ) add_action( ‘wp_dashboard_setup’, ‘wpse_80061_add_dashboard_widget’ ); // your function: // add_action( ‘wp_dashboard_setup’, ‘my_catdb_setup’ ); } function wpse_80061_add_dashboard_widget() { wp_add_dashboard_widget( ‘wpse_80061_widget’, ‘Hey!’, ‘wpse_80061_render_dashboard_widget’ ); } function wpse_80061_render_dashboard_widget() { echo ‘hey!’; } For a dashboard widget … Read more

Query Post Object in WP Admin

The Beta of ACF 5.8 lets you create Gutenberg blocks with custom fields. You can preview these block in the editor. Sadly, you have to be an ACF-Pro customer to use the beta. Otherwise you could try to fetch the custom fields via the REST-API utilizing this plugin: https://github.com/airesvsg/acf-to-rest-api/ Refer to this answer on how … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)