ffmpeg -i source.mp4 -c:v libx264 -b:v 1.5M -c:a aac -b:a 128k dest.mp4
Ref: https://dev.to/benjaminblack/use-ffmpeg-to-compress-and-convert-videos-458l
{ | |
"scripts": { | |
"build": "npm run sass:dev && npm run postcss:build", | |
"dev": "npm run sass:dev && npm run postcss:dev", | |
"watch": "onchange \"assets/scss/**/*.scss\" -- npm run dev", | |
"sass:dev": "sass assets/scss/custom.scss assets/css/custom.css", | |
"postcss:dev": "postcss assets/css/custom.css --use=autoprefixer --output=assets/css/custom.css", | |
"postcss:build": "postcss assets/css/custom.css --use=autoprefixer --use cssnano --output=assets/css/custom.css" | |
}, | |
"browserslist": [ |
// Pause video when slick slide changed | |
$('.act-hero-carousel .the-carousel.carousel-1').on( | |
'beforeChange', | |
function (slick, currentSlide, nextSlide) { | |
var player, command; | |
//find the current slide element and decide which player API we need to use. | |
currentSlide = $('.act-hero-carousel .the-carousel.carousel-1').find( | |
'.slick-current' |
<?php | |
// Get only those services that has people assigned and store them into cache | |
if ( false === ( $available_services_array = get_transient( 'available_services_array' ) ) ) { | |
$available_services_array = array(); | |
$services = new WP_Query( | |
array( | |
'post_type' => array( 'service' ), | |
'posts_per_page' => '500', | |
'post_status' => array( 'publish' ), | |
'order' => 'ASC', |
<?php | |
add_action( 'wp_ajax_testttt', 'testttt' ); | |
function testttt() { | |
$our_people = new WP_Query( | |
array( | |
'post_type' => array( 'people' ), | |
'posts_per_page' => '4', | |
'post_status' => array( 'publish' ), | |
'orderby' => 'rand', | |
'meta_query' => array( |
ffmpeg -i source.mp4 -c:v libx264 -b:v 1.5M -c:a aac -b:a 128k dest.mp4
Ref: https://dev.to/benjaminblack/use-ffmpeg-to-compress-and-convert-videos-458l
<?php | |
// ========= Get embed code from video url for youtube or vimeo ============= | |
function wpmix_get_video_embed( $url ) { | |
$video_type = wpmix_get_video_type( $url ); | |
if ( $video_type == 'youtube' ) { | |
$video_id = wpmix_get_youtube_id( $url ); | |
return '<div class="embed-responsive embed-responsive-16by9"> | |
<iframe width="1268" height="713" src="https://www.youtube.com/embed/' . $video_id . '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | |
</div>'; | |
} elseif ( $video_type == 'vimeo' ) { |
-- Below queries are just to check the failed order records: | |
SELECT * FROM `wp_woocommerce_order_itemmeta` WHERE order_item_id IN (SELECT order_item_id FROM `wp_woocommerce_order_items` WHERE order_id IN (SELECT ID FROM wp_posts WHERE post_type = 'shop_order' AND post_status='wc-failed')) | |
SELECT * FROM `wp_woocommerce_order_items` WHERE order_id IN (SELECT ID FROM wp_posts WHERE post_type = 'shop_order' AND post_status='wc-failed') | |
SELECT * FROM wp_comments WHERE comment_type = 'order_note' AND comment_post_ID IN(SELECT ID FROM wp_posts WHERE post_type = 'shop_order' AND post_status='wc-failed') | |
SELECT * FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'shop_order' AND post_status='wc-failed') |
<?php | |
/** | |
* Change image alt text to product name | |
*/ | |
add_filter('wp_get_attachment_image_attributes', 'wpmix_attachement_image_attributes', 20, 2); | |
function wpmix_attachement_image_attributes( $attr, $attachment ){ | |
// Get post parent | |
$parent = get_post_field( 'post_parent', $attachment); |