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 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); |
1. Rename the folder `mysql/data` to `mysql/data_old` (you can use any name) | |
2. Create a new folder `mysql/data` | |
3. Copy the content that resides in `mysql/backup` to the new `mysql/data` folder | |
4. Copy all your database folders that are in `mysql/data_old` to `mysql/data` (skipping the mysql, performance_schema, and phpmyadmin folders from data_old) | |
5. Finally copy the `ibdata1` and `my.ini` files from `mysql/data_old` and replace it inside `mysql/data` folder | |
6. Start MySQL from XAMPP control panel |
<?php | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |