You can not use conditional tags on init
Queries are only available after “wp” action hook, so ‘init’ is too early to check for it.
Queries are only available after “wp” action hook, so ‘init’ is too early to check for it.
<?php function notify_post_status( $post_id = NULL, $user = ” ) { if ( ! isset($_POST[“post_id”]) ) { $post_id = $_POST[“post_id”]; } else { return $post_id; } $post = get_post($post_id); $status = $post->post_status; $type = $post->post_type; $author_id = intval($post->post_author); $user = get_userdata( $author_id ); //ignore admin if( $author_id == 1 ) return; // Which statuses should…
If you want to add name email or any additional fields in addition to password for protected posts, see the steps below: /****************** custom protected post form *****/ add_filter( ‘the_password_form’, ‘custom_password_form’ ); function custom_password_form() { global $post; $label = ‘pwbox-‘.( empty( $post->ID ) ? rand() : $post->ID ); $a = ‘<div class=”clearfix”><form id=”password_form” class=”protected-post-form” action=”‘…
I needed a placeholder for tags input but it’s boring to display the same tags every time. But unlike posts, WP doesnt have “rand” orderby paramater. So what you can do; is to get a #no of tags and shuffle them. So basically what we do is: Check if we have a recent transient If…
Actually, you do not want to open memcached port in your firewall. #ref: http://serverfault.com/questions/530051/memcached-ports-and-csf
My metaboxes suddenly stopped working. If that’s the case for you, and you are clueless, try resetting $id for your meta_box
Just use javascript:void(0) instead of # for href You might encounter this error most likely in Firefox Console