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.
is_numeric doesnt check strings for numbers. You need to use preg_match(‘#[0-9]#’,$string)
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=”‘…
<?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…
Bir wordpress geleneği “başımıza iş çıkartma”.. 3.7 ile birlikte arkaplanda otomatik güncelleştirmeler eklendi. Günlük blogger için güvenlik açısından kullanışlı özellik olsa da çoğunluk için unutulduğu takdirde başa bela olacaktır. Yeni sürümle değişien core fonksiyonlar, çalışmayan tema & eklentiler, sağda solda hatalar, hatta belkide tamamen sitenin çökmesine sebep olabilir. Arkaplan güncelleştirmelerini kapatmak için wp-config’e eklemeyi unutmamak…
Always check for local time Despite the fact that my server timezone was set correctly, somehow time() was giving wrong ( UTC) hour. So i ended up using wp’s functions to make sure. $now = current_time( ‘timestamp’, 0 ) ;$local_ts = get_the_time(‘U’,$post->ID);
My metaboxes suddenly stopped working. If that’s the case for you, and you are clueless, try resetting $id for your meta_box