Add a custom column in users list page

One thing you should remember is that function, which will be hooked into manage_users_custom_column action must have 3 parameters, the first of which (i.e. $val) should be the returned value: // Add custom column using ‘manage_users_columns’ filter if(!function_exists(‘bm_utm_column’)){ function bm_utm_column($columns) { return array_merge( $columns, array(‘utm_source’ => __(‘UTM source’), ‘utm_medium’ => __(‘UTM medium’) ) ); } … Read more

wordpress upload http error?

Are you on shared hosting by any chance? Shared hosts tend to limit the max uploadable file size on their end and there is nothing you can add to your scripts to change that. If not, then I am mistaken and this is not the solution you are looking for. However, if you are on … Read more

WordPress Left Hand Side Admin Menu Always Collapsed

This will properly override the user settings to keep the menu collapsed for all users: /** * Reset user setting to always collapse the admin menu. * * @see set_user_setting() */ function wpdocs_always_collapse_menu() { if ( ‘f’ != get_user_setting( ‘mfold’ ) ) { set_user_setting( ‘mfold’, ‘f’ ); } } add_action( ‘admin_head’, ‘wpdocs_always_collapse_menu’ );

Replacing the List table of a Post Type

No, you cannot replace the list table. There is no filter, everything is hard-coded. But you can change the post type registration, set show_ui to FALSE to prevent the built-in page, and add a custom page for the post type listing to show the editable items. add_action( ‘wp_loaded’, function(){ register_post_type( ‘test’, array( ‘labels’ => array( … Read more

Hide Admin menus per role in WordPress

you can do this, it hides the menu (thats all , they can still go to the menu url if they know it), based on capability. You can easily change it to role or even username. I think user role is “user_role” and for username it is “user_login”. The example below uses “user_level” of 10 … Read more

Admin pages have no content

Try going to Tools then Export and export your WordPress site into an XML file. Then delete your WordPress site off your web server and reinstall it. Go Tools > Import and click on import and select the XML file. Reinstalling WordPress should fix your problem.

Gallery Settings Change available Columns

Short answer Simple as things sometimes are: No this is not possible. The whole part is hard coded. Long answer (not recommended to do so) You could maybe jump into the esc_html and attribute_escape filters and just return empty there *), but as those are pretty generic names and would possibly also interfere with other … Read more

How to retain HTML5 Attributes on Markup

It is enough to add unfiltered_html capability to Editor role. Add the following code into your current theme’s functions.php: function wpse_change_capability() { $role = get_role( ‘editor’ ); if ( ! $role->has_cap( ‘unfiltered_html’ ) ) $role->add_cap( ‘unfiltered_html’ ); } add_action( ‘init’, ‘wpse_change_capability’, 10 ); Login as the user with Editor role. Test it by editing any … Read more

custom tabs in media uploader

found it. in the automattic SVN for media.php i found the media_upload_header() function, and the only thing left to do is to echo it in the last function: function media_upload_ell_gmap_form() { echo media_upload_header(); ?> <h2>HTML Form</h2> <?php } that’s it.

Add extra field when admin create user

With no hooks on that page (User > Add new page) other then user_new_form_tag its not possible to add new fields unless you hack the core file wp-admin/user-new.php . You could try adding that extra field by adding in in JQuery and processing it when the $_post[‘action’] == ‘adduser’ but that wont be very good … Read more

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