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 | |
/** | |
* 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 ); |
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 custom sub-tab on groups page. | |
*/ | |
function buddyboss_custom_user_tab() { | |
// Avoid fatal errors when plugin is not available. | |
if ( ! function_exists( 'bp_core_new_nav_item' ) || | |
! function_exists( 'bp_loggedin_user_domain' ) || | |
empty( get_current_user_id() ) ) { |
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 | |
/** | |
* Function to return ip address | |
* | |
* @return string IP Address. | |
*/ | |
function get_ip_address() { | |
$ipaddress = ''; | |
if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) { |
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 custom settings. This works for group type field only. | |
* | |
* @param string $tab | |
* @param string $field | |
* | |
* @return void | |
*/ |
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 | |
// Http auth start. | |
$valid_passwords = array( 'bunty' => 'Bunty@123' ); // Key is username and value is password. | |
$valid_users = array_keys( $valid_passwords ); // Get all usernames from $valid_passwords array. | |
$user = $_SERVER['PHP_AUTH_USER']; | |
$pass = $_SERVER['PHP_AUTH_PW']; | |
// Check if user is valid. | |
$validated = ( in_array( $user, $valid_users ) ) && ( $pass == $valid_passwords[ $user ] ); |
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 | |
class acf_field_timezone extends acf_field { | |
/* | |
* __construct | |
* | |
* This function will setup the field type data | |
* |
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 | |
/** | |
* Set user roles as an option. | |
* | |
* @param array $field | |
* @return array | |
*/ | |
function load_roles( $field ) { |