This CSS Stuffing Works, But Is This A Good Practice?

You can use wp_add_inline_style() to add to a stylesheet that you’ve already defined, such as in your plugin. This way an options screen or other user settings can affect the final style output. That could become very tedious, however, depending on how many changes you are giving the user the power over. However, it is … Read more

Set Default Listing “View” in Admin

Although having the feature of persistent settings in core is nice, it may take quite a while before it’s actually accepted. WordPress 3.5 is still quite far away. So let’s augment the global $_REQUEST array instead. add_action( ‘load-edit.php’, ‘wpse34956_force_excerpt’ ); function wpse34956_force_excerpt() { $_REQUEST[‘mode’] = ‘excerpt’; } This will lock up modes, forcing excerpt mode … Read more

WordPress admin stylesheet

Take a look here at the CODEX for an example on how to do this very thing. Example: Load CSS File on All Admin Pages function load_custom_wp_admin_style(){ wp_register_style( ‘custom_wp_admin_css’, get_bloginfo(‘stylesheet_directory’) . ‘/admin-style.css’, false, ‘1.0.0’ ); wp_enqueue_style( ‘custom_wp_admin_css’ ); } add_action(‘admin_enqueue_scripts’, ‘load_custom_wp_admin_style’); Example: Target a Specific Admin Page function my_enqueue($hook) { if( ‘edit.php’ != $hook ) … Read more

Remove the “View” Link in Post Admin

add_filter( ‘post_row_actions’, ‘remove_row_actions’, 10, 1 ); function remove_row_actions( $actions ) { if( get_post_type() === ‘my_cpt’ ) unset( $actions[‘view’] ); return $actions; } Should see you through 🙂 The $actions array consists of the following: $actions[‘edit’] $actions[‘inline hide-if-no-js’] $actions[‘trash’] $actions[‘view’] To modify users grid view ‘user_row_actions‘ filter can be used. For future reference.

Editor Styles and Typekit

Tom Nowell’s TinyMCE plugin solution works brilliantly, just update the JavaScript to use Typekit’s new async code. Once you use the new async embed code, the 403 problem disappears and you’ll have Typekit-enabled TinyMCE with no fuss! Tom has put all the code together in a blog post. He did all the heavy lifting on … Read more

How to use more than 256MB of memory in the admin?

Theoretically, editing your config.php and add this line before wp-settings.php inclusion. define(‘WP_MEMORY_LIMIT’, ‘256M’); should raise your memory limit for WordPress to 256MB or whatever value you set. And this will work sitewide. However, as sorich87 pointed out, there are few functions that will alter this setting with hard coded 256 MB limit. To Hack or … Read more

Set Default Admin Colour For All Users

You can set (in terms of force) a default color within functions.php like this: add_filter( ‘get_user_option_admin_color’, ‘update_user_option_admin_color’, 5 ); function update_user_option_admin_color( $color_scheme ) { $color_scheme=”light”; return $color_scheme; } Update: The following color schemes are available per default at WP 3.8 fresh light blue coffee ectoplasm midnight ocean sunrise Bonus (found on wpmudev): Disable the Admin … Read more

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