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

WordPress Admin back-end – advanced options page?

// Adds ‘ALL’ options page – only accessible for admins and custom roles that have the ‘manage_options’ capability. function wpse31956_all_settings_page() { add_options_page( __(‘All’), __(‘All’), ‘manage_options’, ‘options.php’ ); } add_action( ‘admin_menu’, ‘wpse31956_all_settings_page’ ); Note: As I just saw that me an @ChipBennet posted at nearly the same time: The answer is the same.

Read only capability for custom post in admin area

brasolfilo’s suggestion that you remove the submit meta box is only part of what I’d consider a complete solution. I can hack a “submit” button into that page using FireBug or any of a few other tools, in a matter of minutes. I would… Remove the meta box. This is brasofilo’s solution, and I won’t … Read more

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