This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function() { | |
const video = document.getElementById('video-22_html5_api'); // SET your Video tag ID | |
let previewStarted = false; | |
function isElementInViewport(el) { | |
const rect = el.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get rid of BBApp block compatibility error. | |
* | |
* @param [type] $allow_blocks_for_editor_to_app_editor | |
* @return void | |
*/ | |
function bb_allow_blocks_for_editor_to_app_editor( $allow_blocks_for_editor_to_app_editor ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enable WYSWING editor. | |
function bbp_enable_visual_editor( $r = array() ) { | |
$r['tinymce'] = true; | |
$r['media_buttons'] = true; | |
// Load WHYSWING. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* We have to pass "is_new:0" and apply following filter. | |
*/ | |
function modify_where( $where_sql, $table_prefix, $r ) { | |
$where_sql = str_replace( 'AND is_new = 0', '', $where_sql ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bb_bp_ps_before_search_form( $F ) { | |
$new = new stdClass(); | |
$new->display = 'selectbox'; | |
$new->code = 'age_from'; // to be removed | |
$new->html_name = 'age_from'; | |
$new->value = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function test_callback_migration() { | |
if ( ! is_admin() && isset( $_GET['migrate_data'] ) ) { | |
if ( current_user_can( 'administrator' ) ) { | |
$page = filter_input( INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Converts a number into a short version, eg: 1000 -> 1k | |
function thousandsCurrencyFormat( $num ) { | |
if ( $num > 999 ) { | |
$x = round( $num ); | |
$x_number_format = number_format( $x ); | |
$x_array = explode( ',', $x_number_format ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enqueues the css and js required by the Image Crop. | |
*/ | |
function blp_core_cover_image_scripts() { | |
wp_enqueue_script( 'jcrop', array( 'jquery' ) ); | |
wp_enqueue_script( 'plupload', array(), false, false ); | |
wp_enqueue_style( 'jcrop' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode( 'post_list', 'bunty_shortcode' ); | |
function bunty_shortcode( $attr ) { | |
ob_start(); | |
include_once ABSPATH . 'wp-admin/includes/image-edit.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://bhargavb.com/'; | |
$qr_link = 'https://chart.googleapis.com/chart?chs=224x224&cht=qr&chl='. $url .'&choe=UTF-8'; | |
printf( '<img src="%s" alt="QR Code">', $qr_link ); |
NewerOlder