$query->set('include_children', false);
function get_taxonomy_hierarchy( $taxonomy, $parent = 0 ) {
$taxonomy = is_array( $taxonomy ) ? array_shift( $taxonomy ) : $taxonomy;
$terms = get_terms( $taxonomy, array( 'parent' => $parent, 'hide_empty' => false ) );
$children = array();
foreach ( $terms as $term ){
$term->children = get_taxonomy_hierarchy( $taxonomy, $term->term_id );
$children[ $term->term_id ] = $term;
}
return $children;
}
print_r(get_taxonomy_hierarchy('champ',0));
add_action( 'wp_loaded', 'my_plug_init' );
function my_plug_init() {
if ( isset($_GET['mymegaparam1']) ) {
// some code
return;
}
}
$res = array();
$res[] = array('name'=>4,'order_id' => 12);
$res[] = array('name'=>1,'order_id' => 12);
$res[] = array('name'=>1,'order_id' => 13);
$res[] = array('name'=>3,'order_id' => 13);
$prev = 0;
foreach ($res as $row) {
if ($prev <> $row['order_id'])
{
if ($prev > 0)
echo "конец ряда\n";
echo "начало ряда\n";
}
echo $row['name']."\n";
$prev = $row['order_id'];
}
if ($row['order_id'])
echo "конец ряда\n";
SELECT TOP 1 T.*
FROM (
SELECT T.word,
T.length
FROM (
SELECT TOP 1 *
FROM Table T
WHERE T.length >= 5
ORDER BY T.length
) T
UNION ALL
SELECT T.word,
T.length
FROM (
SELECT TOP 1 *
FROM Table T
WHERE T.length <= 5
ORDER BY T.length DESC
) T
) T
ORDER BY T.length
<?php while ( have_posts() ): the_post(); ?>
<?php get_template_part('content-standard'); ?>
<?php endwhile; ?>
<?php
# запуск импорта
if (file_exists('www/xxx.xxx/process.sig')){
unlink('www/xxx.xxx/process.sig');
exec('/opt/php53/bin/php process.php');
}