Prevent WordPress from abbreviating-long-slugs…-in-the-admin

There is a filter at the end of the function: ‘get_sample_permalink_html’. Hook into this and just replace the shortened form with the full length. <?php # -*- coding: utf-8 -*- /* Plugin Name: T5 Unabridge Permalink Slug */ add_filter( ‘get_sample_permalink_html’, ‘t5_unabridge_sample_permalink’, 10, 2 ); /** * Replaces the shortened permalink with its full form. * … Read more

Prevent widgets removal

The solution I can think of is removing the panels Available and Inactive Widgets so there’s simply nowhere to drag (and delete) the widgets used in the sidebar. You can inject something else to fill the gap. In this example, only one user is able to add/delete widgets. function wpse_53398_script_printer(){ // used to display the … Read more

How to hide admin account in BuddyPress? (for security reasons)

I found this: Exclude Users from Members directory on a BuddyPress based social network We will need to hook to ‘bp_ajax_querystring’ filter. The following code will allow to exclude the users from the members directory. They will be still listed in the friends list of other users with whom they are friends with. add_action(‘bp_ajax_querystring’,’bpdev_exclude_users’,20,2); function … Read more

WP List Table custom quick edit box – post meta data missing and columns change on submit

I just run in the same error when adding extra columns to the default post types. The offending line was the $pagenow check. Quick Edit uses admin-ajax.php so it doesn’t renders the custom columns when it’s done. This doesn’t work: if( ‘edit.php’ == $pagenow && is_admin() ) { add_action( ‘admin_init’, array( $this, ‘init_id_column’ ), 999 … Read more

How to remove categories filter from wordpress admin?

I tested this and it works for removing the categories dropdown on the All Posts page: add_action( ‘load-edit.php’, ‘no_category_dropdown’ ); function no_category_dropdown() { add_filter( ‘wp_dropdown_cats’, ‘__return_false’ ); } — below: old answer when I misunderstood the question — The code you posted works just fine for me. But here’s an alternative you might try: add_filter(“manage_posts_columns”, … Read more

How to Change the Categories Order in the Admin Dashboard?

Found an answer in this answer. add_filter( ‘get_terms_args’, ‘wpse_53094_sort_get_terms_args’, 10, 2 ); function wpse_53094_sort_get_terms_args( $args, $taxonomies ) { global $pagenow; if( !is_admin() || (‘post.php’ != $pagenow && ‘post-new.php’ != $pagenow) ) return $args; $args[‘orderby’] = ‘slug’; $args[‘order’] = ‘DESC’; return $args; } The order may be ASC or DESC, and the orderby can be: count … Read more

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