Dashboard Widget Form

That if(‘POST’…) just alone -in the middle of the plugin code- doesn’t seem right. You can hook into load-$pagenow and process the form submission there: add_action( ‘load-index.php’, ‘check_posted_data’ ); function check_posted_data() { if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘my_prefix_message’] ) ) { wp_die( “I’m here! {$_POST[‘my_prefix_message’]}” ); } } Please note that you’re missing security … Read more

Dashboard Whitescreen of Death?

You have active a plugin or theme, that include scripts or styles via function wp_enqueue_style and wp_enqueue_script. Since version 3.3 is it not possible to enqueue script and styles without a hook. Find the source and fix this, is easy to do that. The codex have for this topic a fine documentation. /** * Proper … Read more

How To Get User Data in Callback Function for pre_user_nicename?

If anyone should be faced with this problem, check if you have defined a callback function to set the user_login on pre_user_login. This filter is applied inside the wp_insert_user()-function and produced a same username again. Therefore the nicename was changed by adding a “-2”. So, my problem was that I reset the user_logins again and … Read more

Custom WordPress Dashboard for Specific user role

Basic implementation: Create a page for the frontend (and optionally a template). Then add the following code to your functions.php: function login_redirect_capability() { if ( current_user_can(‘author’) || current_user_can(‘editor’) ){ return ‘url-of your custom page’; } } add_filter(‘login_redirect’, ‘login_redirect_capability’); This will redirect them to the page you created. If you want to recode the dashboard as … Read more

Redirect all pages to homepage but still allow dashboard

Just use ‘ template_redirect ‘ hook This action hook executes just before WordPress determines which template page to load. It is a good hook to use if you need to do a redirect with full knowledge of the content that has been queried. add_action(‘template_redirect’,’redirect_all_pages_to_home’); function redirect_all_pages_to_home() { if ( ! is_front_page() ) { wp_redirect( get_home_url() … Read more

Add new section to “Right Now” widget

I believe the hook you are looking for is right_now_discussion_table_end Update: From your comment i see that i did not explain myself, WordPress closes the table and div just after right_now_discussion_table_end action hook so you can use right_now_discussion_table_end and at the begging of your function close the table and div yourself and open your own, … Read more

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