Settings API – adding setting fields dynamically?

It sounds like you would need a way to get those dynamic fields into the my_options function each time it’s called. You could try creating your own filter to use: function my_options() { $myarray = apply_filters( ‘my_get_options_dynamically’, array() ); $count = 0; foreach($myarray as $something) { $count++; $options[] = array( ‘id’ => ‘something’. $count, ‘title’ … Read more

How to save dismissable notice state in WP 4.2?

There’s no need for a library, it’s fairly straightforward to accomplish. If you are coding your own plugin (which it appears you are), then you can do this in a fairly lightweight way: A slightly modified version of the notice, which checks if it’s been dismissed before displaying, and stores the “type” of notice in … Read more

Securing Admin Accounts – Username Discovery

If you have pretty permalinks enabled WordPress will redirect all calls to /?author=1 to the author archive with the user name, eg.: /author/bob/. And then the visitor will know the author name. Use Login Lockdown, that plugin does not reset accounts, it will block IP addresses.

Is it possible to create a WordPress tour? V3.3.1

If you look at this plugin I wrote as a demonstration on using pointers, you will see how to create them and have them close correctly: https://github.com/Tarendai/WP-Pointer-Pointers This plugin creates ‘pointer pointers’:

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

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

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

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