<?php
require 'rb.php';
R::setup();
//for version 5.3 and higher
//optional but recommended
R::useFeatureSet( 'novice/latest' );
$post = R::dispense( 'post' );
$post->text = 'Hello World';
//create or update
$id = R::store( $post );
//retrieve
$post = R::load( 'post', $id );
//delete
R::trash( $post );
<?php $loop = new WP_Query( array('post_type' => 'post','posts_per_page' => -1,'order' => 'ASC',));
while ( $loop->have_posts() ): $loop->the_post(); ?>
<?php if (get_field('name_field') == 'yes'): ?>
// echo
<?php endif ?>
<?php endwhile; wp_reset_postdata(); ?>
function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){
// $pct - уровень прозрачности при наложении 0 .. 100
if(!isset($pct)){
return false;
}
$pct /= 100;
$w = imagesx( $src_im );
$h = imagesy( $src_im );
imagealphablending( $src_im, false );
$minalpha = 127;
for( $x = 0; $x < $w; $x++ )
for( $y = 0; $y < $h; $y++ ){
$alpha = ( imagecolorat( $src_im, $x, $y ) >> 24 ) & 0xFF;
if( $alpha < $minalpha ){
$minalpha = $alpha;
}
}
for( $x = 0; $x < $w; $x++ ){
for( $y = 0; $y < $h; $y++ ){
$colorxy = imagecolorat( $src_im, $x, $y );
$alpha = ( $colorxy >> 24 ) & 0xFF;
if( $minalpha !== 127 ){
$alpha = 127 + 127 * $pct * ( $alpha - 127 ) / ( 127 - $minalpha );
} else {
$alpha += 127 * $pct;
}
$alphacolorxy = imagecolorallocatealpha( $src_im,
( $colorxy >> 16 ) & 0xFF,
( $colorxy >> 8 ) & 0xFF,
$colorxy & 0xFF, $alpha
);
if( !imagesetpixel( $src_im, $x, $y, $alphacolorxy ) ){
return false;
}
}
}
imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
}