$post->user->first_name
#run echo $(id -u):$(id -g) and copypaste it to HOST_USER variable
#HOST_USER is needed to run docker containers under current user on host machine
HOST_USER=1234:1234
version: "3"
services:
nginx:
image: nginx:latest
ports:
- "8081:80"
volumes:
- .:/app
- ./docker/nginx/:/etc/nginx/conf.d/
depends_on:
- php-fpm
working_dir: /app
networks:
- internal
php-fpm:
user: ${HOST_USER}
working_dir: /app
build:
context: ./docker/php-fpm
dockerfile: Dockerfile
volumes:
- .:/app
- ./docker/php-fpm/log/:/var/log/
- /etc/group:/etc/group:ro #####вот
- /etc/passwd:/etc/passwd:ro #####вот
ports:
- '9000:9000'
networks:
- internal
environment:
XDEBUG_CONFIG: "remote_host=192.168.220.1 remote_enable=1"
PHP_IDE_CONFIG: "serverName=PHPSTORM"
function getVideoID ($url)
{
preg_match("%^(?:https?://)?(?:www\.|m\.)?(?:youtu\.be/|youtube(?:-nocookie)?\.com(?:/watch\?v=|/watch/\?v=|/embed/|/v/))([\w-]{10}[048AEIMQUYcgkosw]{1})($|\S+).*$%x", $url, $matches);
return $matches[1] ?? "";
}
echo getVideoID("https://youtu.be/DBXH9jJRaDk?t=11");
//DBXH9jJRaDk
echo getVideoID("https://www.youtube.com/embed/DBXH9jJRaDk");
//DBXH9jJRaDk
echo getVideoID("https://www.youtube.com/watch?v=DBXH9jJRaDk&t=30&feature=emb_logo");
//DBXH9jJRaDk
echo getVideoID("https://www.youtube.com/watch?v=DBXH9jJRaDk");
//DBXH9jJRaDk
echo getVideoID("https://m.youtube.com/watch?v=DBXH9jJRaDk&t=30");
//DBXH9jJRaDk
preg_match('/\?v=([a-zA-Z0-9_\-]+)/', $url, $matches);
print_r($matches[1]);
...
$customizer->get_setting('blogname')->transport='postMessage';
$customizer->get_setting('blogdescription')->transport='postMessage';
...
//$wp_customize->add_setting('header_h1',array('transport'=>'postMessage'));
(function($){
var api=wp.customize;
api('blogname',function(value){value.bind(function(to){$('.site-title a').text(to);});});
api('blogdescription',function(value){value.bind(function(to){$('.site-description a').text(to);});});
...
$wp_customize->add_setting('header_h1');
add_action( 'customize_register', 'hgjghjghj' );
function hgjghjghj($wp_customize){
$wp_customize->add_panel(
'panel_main_page',
array(
'title' => 'Контент на главной странице',
'priority' => 999,
)
);
$wp_customize->add_section(
'header_h1',
array(
'panel' => 'panel_main_page',
'title' => 'Заголовок (h1) страницы',
'priority' => 0,
)
);
$wp_customize->add_setting(
'header_h1',array('transport'=>'postMessage')
);
$wp_customize->add_control(
'header_h1',
array(
'section' => 'header_h1',
'label' => 'Текст заголовка',
'type' => 'text'
)
);
}
...
api('header_h1',function(value){value.bind(function(to){$('#qweqweqwe').text(to);});});
...
//подключаем js для превью через add_action('customize_preview_init','preview_customize_enqueue');
//либо пишем калбак функцию и пишем js в ней...
echo '<div id="qweqweqwe">'.get_theme_mod('header_h1').'</div>';
public function dataIndex(Request $request, $id)
{
$data = Data::where(['server_id' => $id])->orderByDesc('created_at')->limit($request->get('limit', 25))->get();
$result = $data->sortBy('id')->values()->all();
return response($result);
}