Allow admin login at /admin

another option – redirect /admin/ to wp-login.php with a parse_query action hook: function wpa53048_parse_query( $query ){ if( $query->query_vars[‘pagename’] == ‘admin’ ): wp_redirect( wp_login_url() ); exit; endif; } add_action( ‘parse_query’, ‘wpa53048_parse_query’ ); EDIT Well the above apparently only works with certain permalink structures. Here’s another method hooked to parse_request: function wpa53048_parse_request( $query ){ if( $query->request == … Read more

Can I set a default dashboard layout for all users?

Hi @Relequestual: I think what you want is here: Dashboard Widgets API / Advanced: Forcing your widget to the top It doesn’t require you to change code per se, just to add the code like shown in the WordPress Codex to your theme’s functions.php file which is a standard way to customize and/or extend WordPress: … Read more

front end logo upload like happytables

I actually wrote this for Happy Tables so should be able to give you a couple of pointers, though I don’t have time to go into too much depth at the moment. We use this “image well” on tables tables a fair bit, it’s basically the drag/drop upload from the WordPress upload. Similar to something … Read more

How to change WordPress default strings?

Additionally to kaiser’s answer, you can load customized .mo files that overrides the original file using load_textdomain_mofile filter. For example: add_filter( ‘load_textdomain_mofile’, ‘cyb_filter_load_textdomain_mofile’, 10, 2 ); function cyb_filter_load_textdomain_mofile( $mofile, $domain ) { if ( $domain == ‘some-textdomain-to-override’ ) { $mofile = WP_LANG_DIR . ‘/overrides/’ . basename( $mofile ); } return $mofile; } It may be … Read more

use add_settings_field properly?

Documentation for add_settings_field() Says following: You MUST register any options used by this function with register_setting() or they won’t be saved and updated automatically.

Disable the post save process completely

function disable_save( $maybe_empty, $postarr ) { $maybe_empty = true; return $maybe_empty; } add_filter( ‘wp_insert_post_empty_content’, ‘disable_save’, 999999, 2 ); Because wp_insert_post_empty_content is set to true, WordPress thinks there is no title and no content and stops updating the post. EDIT: An even shorter variant would be: add_filter( ‘wp_insert_post_empty_content’, ‘__return_true’, PHP_INT_MAX -1, 2 );

Set Featured Image programmatically (in admin) with JavaScript?

You need to do an ajax call with action: ‘set-post-thumbnail’ Check in admin-ajax.php (line 1477 in 3.3.2) for the expected values and nonce, but in general you need to send post_id, attachment_id and nonce. The nonce should come from: wp_create_nonce( “set_post_thumbnail-$post_id” ); The admin does something like: uploader.bind(‘FileUploaded’, function(up, file, response) { jQuery.post(ajaxurl, { action:”set-post-thumbnail”, … Read more

Cannot login to WordPress Admin with SSL terminated load balancer

I just figured out the issue. You need to add the HTTPS/SSL settings before require_once(ABSPATH . ‘wp-settings.php’); in your wp-config.php So the relevant part of your wp-config.php should look like this. define( ‘FORCE_SSL_ADMIN’, true ); // in some setups HTTP_X_FORWARDED_PROTO might contain // a comma-separated list e.g. http,https // so check for https existence if( … Read more