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 ); |
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_action( | |
'elementor/theme/register_conditions', | |
function( $conditions_manager ) { | |
class Page_Template_Condition extends ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base { | |
public static function get_type() { | |
return 'singular'; | |
} |
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 user profile extra fields. | |
* | |
* @param object $user | |
* @return void | |
*/ | |
function buntywp_extra_user_profile_fields( $user ) { | |
$extra_field = get_user_meta( $user->ID, 'extra_field', true ); |
NewerOlder