admin-post.php?action=some/action
add_action( 'admin_post_some/action', 'some_action_post_callback' );
function some_action_post_callback() {
//do something with form data and redirect to url
}
function getParents($id, $parents=array())
{
if (empty($id)) {
return $parents
} else {
//тут селект запрос, которые выбирает парент айди с базы по $id
$parents[] = $parent_id;
return getParents($parent_id, $parents);
}
}
$id = 4;
$parents = getParents($id);
SELECT t1.id, t2.id, t3.id
FROM sometable as t1
LEFT JOIN somateble as t2 ON t2.id = t1.parent_id
LEFT JOIN somateble as t3 ON t3.id = t2.parent_id
function getShapeParams() {
var shapeParams = {};
shapeParams = {
radius: document.getElementsByClassName('radius')[0].value.toString(),
x1Crd: document.getElementsByClassName('circle-x1-crd')[0].value.toString(),
x2Crd: document.getElementsByClassName('circle-y2-crd')[0].value.toString()
};
console.log(shapeParams.radius);
return shapeParams;
}
getShapeParams(shapeParams);
заменить на var shapeParams = getShapeParams();
и все должно работать.var shapeParams = {};
function getShapeParams() {
shapeParams = {
radius: document.getElementsByClassName('radius')[0].value.toString(),
x1Crd: document.getElementsByClassName('circle-x1-crd')[0].value.toString(),
x2Crd: document.getElementsByClassName('circle-y2-crd')[0].value.toString()
};
console.log(shapeParams.radius);
}
function circle() {
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
getShapeParams();
this.radius = shapeParams.radius;
this.x1Crd = shapeParams.x1Crd;
this.x2Crd = shapeParams.x2Crd;
context.clearRect(0, 0, canvas.width, canvas.height);
context.beginPath();
context.arc(x1Crd, x2Crd, radius, 0, Math.PI*2, false);
context.fillStyle = 'red';
context.fill();
context.lineWidth = 1;
context.strokeStyle = 'red';
context.stroke();
}
circle();
$('li:nth-child(n5)').hide();
function showNextSlide() {
var $activeslide = $('#support .slide.active');
var $nextslide = $activeslide.next();
if ($nextslide.length == 0) {
$nextslide = $('#support .slide').first();
}
$activeslide.removeClass('active');
$nextslide.addClass('active');
}
var loop = window.setInterval('showNextSlide',1000);
$('#support nav a').click(function(e) {
e.preventDefault();
$(this).addClass('active').siblings().removeClass('active');
var tab = $(this).data('id');
$('#support .slide[data-id="' + tab + '"]').addClass('active').siblings().removeClass('active');
//добавить эти строки
window.clearInterval(loop);
loop = null;
});
<td><input type="checkbox" name="theme_settings[show_block_2]" id="theme_settings[show_block_2]" value="1"<?php if($options[show_block_2]=='1') echo ' checked="checked"';?> /></td>
<input type="hidden" name="theme_settings[show_block_1]" value="0">
<div class="info">
<div class="info_video">
<span data-show="items_video">Информация</span>
<span data-show="downoload">Скачать</span>
</div>
<div class="items items_video">
<div class="info_item">
<li>Просмотров:<?php echo $movie['views']; ?></li>
<li>Добавил:</li>
<li>Добавлено:<?php echo $movie['date_format']; ?></li>
</div>
<div class="info_item">
<li>Продолжительность: </li>
<li>Размер: </li>
<li>Категория: </li>
</div>
</div>
<div class="items downoload">
</div>
$('.info_video span').click(function() {
$('.items').hide();
$('.'+$(this).data('show')).show();
});
SELECT id, name FROM category WHERE id in (Select parent_category_id FROM category GROUP BY parent_category_id HAVING count(*) <=3)
SELECT category.id, category.name FROM category LEFT JOIN category as ct ON category.id = ct.parent_category_id WHERE ct.parent_category_id is NUll AND category.parent_category_id <> 0
$val['COUNT']=$val['COUNT'] - 1;
$val['COUNT']=$val['COUNT'] + 1;
$arrBasket
не изменяется. Вам нужно или изменить эти записи на такие$arrBasket['basket']['products'][$key]['COUNT']--;
$arrBasket['basket']['products'][$key]['COUNT']++;
foreach($arrBasket['basket']['products'] as $key=>&$val)
$arr[0]->getId();
$('.TestBlock').on('touchstart', function(event) {
// bla bla bla
}),false;
$('.TestBlock').on('touchmove',function(event) {
//bla bla bla
}),false;
$('.TestBlock').on('touchend',function(event) {
console.log('End');
}),false:
$('.TestBlock').on('touchstart', function(event) {
// bla bla bla
$(this).off('touchmove');
$(this).on('touchmove',function(event) {
//bla bla bla
}),false;
$(this).off('touchend');
$(this).on('touchend',function(event) {
console.log('End');
}),false:
}),false;
<div class="slider-block-element">
<div class="desc" style="display:none;">{{ target.description }}</div>
....
</div>
<script type="text/javascript">
$(document).ready(function() {
$('.slider-block-element').on('click',function() {
$('#description').html($(this).find('.desc').html());
})
});
</script>
function camelize (myString) {
var camelCased = myString.toLowerCase()
.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); })
.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); });
return camelCased;
}
alert(camelize('get_test-metod')); // вернет getTestMetod
myString.replace(/_/g, '-');
function dashed(myString, separator) {
if (!separator) separator = '-';
var dashedCased = myString.replace(/([A-Z])/g, separator + '$1').toLowerCase();
return dashedCased;
}
class Blank {
public function __call($name, $arguments) {
return this;
}
}
SELECT name_room, COUNT(*) as count_author FROM (SELECT name_room, author_id FROM publications GROUP BY name_room, author_id) GROUP BY count_author DESC LIMIT 5