#menu .current-menu-item > a,#menu .current-menu-ancestor > a,#menu .current_page_item > a,#menu .current_page_ancestor > a{
-moz-box-shadow:0px 2px 0px rgba(0,0,0,1);
-webkit-box-shadow:0px 2px 0px rgba(0,0,0,1);
box-shadow:0px 2px 0px rgba(0,0,0,1);
}
add_action('add_meta_boxes','VAB_short_for_posts_meta_box');
if(!function_exists('VAB_short_for_posts_meta_box')){
function VAB_short_for_posts_meta_box(){
$screens=array('post');
add_meta_box('post_meta',__('Лайки поста','VAB'),'post_meta_box_callback',$screens,'side','high');
}
}
if(!function_exists('post_meta_box_callback')){
function post_meta_box_callback($post,$meta){
$screens=$meta['args'];
$post_meta=get_post_meta($post->ID,'_recommended');
echo __('<label for="_recommended"><input id="_recommended" size="4" type="text" name="_recommended" value="'.$post_meta[0].'"></label>';
}
}
add_action('edit_post','VAB_update_post_meta',10,2);
function VAB_update_post_meta($post_ID,$post){
//создание метабокса
add_action('add_meta_boxes','nivo_meta_box');
function nivo_meta_box(){
$screens=array('vabmegaslider');
add_meta_box('nivo_meta',__('Слайдер «Nivo»','VAB'),'nivo_meta_box_callback',$screens,'side','low');}
function nivo_meta_box_callback($post,$meta){
wp_nonce_field('VAB_mode_slider_nonce','VAB_slider_nonce');//вот оно
.....
//обновление поста и вместе с ним мета поля с проверками
add_action('edit_post','VAB_update_post_meta',10,2);
function VAB_update_post_meta($post_ID,$post){
$nonce=filter_input(INPUT_POST,'VAB_slider_nonce',FILTER_SANITIZE_STRING);
if(!$nonce){return $post_ID;}
if(!wp_verify_nonce($nonce,'VAB_mode_slider_nonce')){return;}
if(defined('DOING_AUTOSAVE')&&DOING_AUTOSAVE){return;}
if(!current_user_can('edit_post',$post_ID)){return;}
$post_type=get_post_type($post_ID);
....
global $wpdb;
if (!is_numeric($post_id)) return;
$text_zero_suffix = sanitize_text_field($text_zero_suffix);
$text_one_suffix = sanitize_text_field($text_one_suffix);
$text_more_suffix = sanitize_text_field($text_more_suffix);
switch ($action) {
case 'get':
$recommended = get_post_meta($post_id, '_recommended', true);
if (!$recommended) {
$recommended = 0;
add_post_meta($post_id, '_recommended', $recommended, true);
}
$post_meta=get_post_meta($thepostid,'_recommended');
echo $post_meta[0];
$post_meta=get_post_meta('77','_recommended');
echo $post_meta[0];
$(document).pjax('[go_pjax] a','#CenteBig,#wp-calendar',{fragment:'#CenteBig,#wp-calendar',timeout:44444,scrollTo:No_Yes_scroll_To,push:true});
на всякий пожарный
if ( $previous ) { $calendar_output .= "\n\t\t" . '<td colspan="3" id="prev"><a href="' . get_month_link( $previous->year , $previous->month ) . '" title="' . sprintf( __( 'View posts for %1$s %2$s' ) , $wp_locale->get_month( $previous->month ) , date( 'Y' , mktime( 0 , 0 , 0 , $previous->month , 1 , $previous->year ) ) ) . '">« ' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) . '</a></td>';
} else {
$calendar_output .= "\n\t\t" . '<td colspan="3" id="prev" class="pad"> </td>';
}
$calendar_output .= "\n\t\t" . '<td class="pad"> </td>';
if ( $next ) { $calendar_output .= "\n\t\t" . '<td colspan="3" id="next"><a href="' . get_month_link( $next->year , $next->month ) . '" title="' . esc_attr( sprintf( __( 'View posts for %1$s %2$s' ) , $wp_locale->get_month( $next->month ) , date( 'Y' , mktime( 0 , 0 , 0 , $next->month , 1 , $next->year ) ) ) ) . '">' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) . ' »</a></td>';
} else {
$calendar_output .= "\n\t\t" . '<td colspan="3" id="next" class="pad"> </td>';
}