 
  
  

 
         
  
   
  
   
  
   
  
  define( 'WP_DEBUG', true );
Notice: Функция has_cap вызвана с аргументом, который считается устаревшим с версии 2.0.0! Использование уровней для пользователей устарело. Используйте возможности.. in /public_html/wp-includes/functions.php on line 4546
Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-includes/functions.php:4546) in /public_html/wp-admin/includes/misc.php on line 1198
add_shortcode( 'doctor',  'call_shortcode_doctor' );
    function call_shortcode_doctor( $atts, $content = '' ) {
        global $wp_query;
        $atts = shortcode_atts( array( 'id' => null ), $atts );
        $wp_query = new WP_Query( array(
            'post_type' => 'doctors',
            'p' => intval( $atts['id'] )
        ) );
    ob_start();
    echo '<div class="doctor">';
        if ( have_posts() ) :
                while ( have_posts() ) : the_post();
                    get_template_part( 'template-parts/doctor', get_post_format() );
                endwhile;
            else :
                get_template_part( 'template-parts/content', 'none' );
            endif;
    echo '</div>';
        wp_reset_query(); // сброс $wp_query
        $out = ob_get_clean();
        return $out;
    }<?php
add_action( 'init', 'health_doctors' ); // Использовать функцию только внутри хука init
function health_doctors() {
	$labels = array(
		'name' => 'Доктора',
		'singular_name' => 'Доктор', // админ панель Добавить->Функцию
		'add_new' => 'Добавить доктора',
		'add_new_item' => 'Добавить нового доктора', // заголовок тега <title>
		'edit_item' => 'Редактировать доктора',
		'new_item' => 'Новый доктор',
		'all_items' => 'Все доктора',
		// 'view_item' => 'Просмотр продукта на сайте',
		'search_items' => 'Искать доктора',
		'not_found' =>  'Докторов не найдено.',
		'not_found_in_trash' => 'В корзине нет докторов.',
		'menu_name' => 'Доктора' // ссылка в меню в админке
	);
	$args = array(
		'labels' => $labels,
		'public' => false,
        //'rewrite' => array('slug' => 'health/%health%'),
		'show_ui' => true, // показывать интерфейс в админке
		'has_archive' => true,
		'menu_icon' => 'dashicons-businessman', // иконка корзины
		'menu_position' => 20, // порядок в меню
		'supports' => array( 'title', 'editor', 'comments', 'author', 'thumbnail', 'revisions')
	);
	register_post_type('doctors', $args);
}
add_action("admin_init", "admin_init_job");
    add_action('save_post', 'save_job_position_doc');
    function admin_init_job(){
        add_meta_box("job_position_doc", "Дополнительно", "meta_options_doc", "doctors", "side", "high");
    }
    function meta_options_doc(){
        global $post;
        $custom = get_post_custom($post->ID);
        $job_position_doc = $custom["job_position_doс"][0];
        $custom_id = $post->ID;
?>
    <!-- <label>Должность:</label><input name="job_position" type="text" style="width: 100%;" value="<?php echo $job_position_doc; ?>" /> -->
    <label>Айдишник:</label><input name='doctor_id' type='text' style='width: 100%;' value='[doctor id="<?php echo $custom_id; ?>"]' readonly/>
<?php
    }
	function save_job_position_doc(){
		global $post;
		update_post_meta($post->ID, "job_position_doс", $_POST["job_position_doc"]);
	}
add_shortcode( 'doctor',  'call_shortcode_doctor' );
    function call_shortcode_doctor( $atts, $content = '' ) {
        global $wp_query;
        $atts = shortcode_atts( array( 'id' => null ), $atts );
        $wp_query = new WP_Query( array(
            'post_type' => 'doctors',
            'p' => intval( $atts['id'] )
        ) );
    ob_start();
    echo '<div class="doctor">';
        if ( have_posts() ) :
                while ( have_posts() ) : the_post();
                    get_template_part( 'template-parts/doctor', get_post_format() );
                endwhile;
            else :
                get_template_part( 'template-parts/content', 'none' );
            endif;
    echo '</div>';
        wp_reset_query(); // сброс $wp_query
        $out = ob_get_clean();
        return $out;
    }
?>Notice: Функция has_cap вызвана с аргументом, который считается устаревшим с версии 2.0.0! Использование уровней для пользователей устарело. Используйте возможности.. in /public_html/wp-includes/functions.php on line 4546
Warning: Cannot modify header information - headers already sent by (output started at /home/globa79/public_html/wp-includes/functions.php:4546) in /public_html/wp-admin/includes/misc.php on line 1198
Notice: Undefined index: job_position_clinic in /public_html/wp-content/themes/Ember/inc/clinics.php on line 54
Notice: Undefined index: job_position_doc in /public_html/wp-content/themes/Ember/inc/doctors.php on line 54
Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-includes/functions.php:4546) in /public_html/wp-admin/post.php on line 222
Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-includes/functions.php:4546) in /public_html/wp-includes/pluggable.php on line 1251
Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-includes/functions.php:4546) in /public_html/wp-includes/pluggable.php on line 1254 
  
   
  
   
  
  