Cookie value cannot be read until I’ve logged into the WP admin

It appears I needed to use an earlier hook. Using the wp or init action hooks allow me to read the cookie’s value without logging into the admin first. function output_test_cookie() { if ( isset( $_COOKIE[‘test-cookie’] ) ) echo $_COOKIE[“test-cookie”]; } add_action( ‘wp’, ‘output_test_cookie’ ); // wp or init is needed

Add filter-by-tag in the all posts admin console page

User ‘restrict_manage_posts’ filter to add another filter. Use the following code in functions.php function kc_add_taxonomy_filters() { global $typenow; // an array of all the taxonomyies you want to display. Use the taxonomy name or slug $my_taxonomies = array( ‘post_tag’ ); switch($typenow){ case ‘post’: foreach ($my_taxonomies as $tax_slug) { $tax_obj = get_taxonomy($tax_slug); $tax_name = $tax_obj->labels->name; $terms … Read more

Elegantly using JavaScript on widget admin forms

One way around this I’ve discovered since posting the above question is to instantiate inline via WP_Widget::form(), with wp_enqueue_script() loading the necessary JavaScript (exactly as mentioned above) — except, and here’s the key part, load the JavaScript in the header instead of the footer (fifth argument of wp_enqueue_script()). Which makes a lot of sense now … Read more

Subsites in Multisite installation throwing 404 error on wp-admin in IIS 7

Figured out the issue. It was with the generated “WordPress Rule 6”. It was giving 2 identical regex expressions. Removed the extra regex expression. Also had to remove “WordPress Rule 5”. Renumber the rules and now everything works fine. Here’s the updated web.config: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”WordPress Rule 1″ stopProcessing=”true”> … Read more