$('.add_question').on('click', function() {
$('<div class="question__block">111</div>').insertBefore('.add_question');
});
$('.add_answer').on('click', function() {
if (validate) {
$('#create_new_polls .questions__block').each(function(index, value) {
console.log(index);
});
}
});
$('.add_question').on('click', function() {
$('<div class="question__block">111</div>').insertBefore('.add_question');
});
$('.add_answer').on('click', function() {
if (validate) {
$('#create_new_polls .questions__block').each(function(index, value) {
console.log(index);
});
}
});
$.getJSON('https://maps.google.com/maps/api/geocode/json?address=<?=$adress;?>&key=jklhjklhjklhjkl&results', function(data) {
window.adress[<?=$id;?>] = data.results[0].geometry.location.lat + ':' + data.results[0].geometry.location.lng;
$labels = array(
'name' => _x( 'Продукты', 'taxonomy general name' ),
'singular_name' => _x( 'product_list', 'taxonomy singular name' ),
'search_items' => __( 'Search product' ),
'all_items' => __( 'All Products' ),
'parent_item' => __( 'Parent product' ),
'parent_item_colon' => __( 'Parent product:' ),
'edit_item' => __( 'Edit product' ),
'update_item' => __( 'Update product' ),
'add_new_item' => __( 'Add New product' ),
'new_item_name' => __( 'New product Name' ),
'menu_name' => __( 'Продукты' ),
);
register_post_type(
'products_list',
array(
'labels' => $labels,
'exclude_from_search' => false,
'has_archive' => true,
'public' => true,
'publicly_queryable' => true,
'rewrite' => true,
'can_export' => true,
'show_in_nav_menus' => true,
'supports' => array('title', 'editor', 'thumbnail', 'comments', 'page-attributes','excerpt', 'custom-fields'),
'show_in_rest' =>true,
)
);
register_taxonomy(
'product_cats',
'products_list',
array(
'hierarchical' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'labels' =>array(),
'query_var' => true,
'rewrite' => array('slug' => 'product_cats'),
'show_in_rest' => true,
)
);