Sync User to cPanel webmail?

You would have to write this from scratch but it is entirely possible. cPanel webmail is already configured to work with Horde, Roundcube and SquirrelMail which are all open source and very well documented. The main issue that wouldn’t make it seamless is that cPanel uses exim4 as an email server and there would be … Read more

Remove “You are using WordPress 3.2.1” from Right Now Dashboard Widget

There is a trick to get rid of this using the gettext filter for translations. This basically replaces it with nothing. add_filter(‘gettext’, ‘remove_admin_stuff’, 20, 3); function remove_admin_stuff( $translated_text, $untranslated_text, $domain ) { $custom_field_text=”You are using <span class=”b”>WordPress %s</span>.”; if ( is_admin() && $untranslated_text === $custom_field_text ) { return ”; } return $translated_text; } Be aware … Read more

Modifying the built-in behavior of ajax tag type-ahead functionality of WordPress

Very difficult. The value is hard coded in wp-admin/js/post.js. See wp-admin/js/post.dev.js tagBox.init() for more readable code: $(this).suggest( ajaxurl + ‘?action=ajax-tag-search&tax=’ + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: postL10n.comma + ‘ ‘ } ); The only solution I can see: Unregister the script with the handle ‘post’ (see wp-includes/script-loader.php) and register a custom … Read more

Dashboard widget custom positioning?

The dashboard widget function wp_add_dashboard_widget() is just a wrapper for add_meta_box(). So you can use the underlying function instead. add_meta_box( ‘my_comments_user_dashboard_widget’ ,’My comments’ ,’dashboard_user_comments_widget_function’ ,$screen // Take a look at the output of `get_current_screen()` on your dashboard page ,’normal’ // Valid: ‘side’, ‘advanced’ ,$priority // Valid: ‘default’, ‘high’, ‘low’ );

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

remove post and categories/tags count from right now dashboard widget

There is no filter in PHP, so we have to use JavaScript: add_action( ‘admin_footer-index.php’, ‘wpse_82132_hide_rows’ ); function wpse_82132_hide_rows() { $rows = array ( # ‘posts’, # ‘pages’, ‘cats’, // meoww! ‘tags’, # ‘comments’, # ‘b_approved’, # ‘b-waiting’, # ‘b-spam’, ); $find = ‘.’ . join( ‘,.’, $rows ); ?> <script> jQuery( function( $ ) { … Read more

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