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 | |
/** | |
* Members Directory - Include Users By Meta_key & Meta_value | |
*/ | |
function yz_include_members_directory_by_verified( $loop ) { | |
if ( ! bp_is_members_directory() ) { | |
return $loop; | |
} |
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 | |
/** | |
* Access to Private Property of Class And Remove Action From Class | |
* add_action pirority is very important => 9 | |
*/ | |
function remove_action_from_class(){ | |
global $Youzer; | |
$myClassReflection = new ReflectionClass( get_class( $Youzer ) ); | |
$secret = $myClassReflection->getProperty('instance'); | |
$secret->setAccessible(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 | |
final class Plugin_Name { | |
private function __construct() { | |
register_activation_hook( __FILE__, array( $this, 'plugin_activation' ) ); | |
} | |
public function plugin_activation() { | |
if ( get_option( 'plugin_version' ) != PLUGIN_VERSION ) { |
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 bp_force_user_to_set_profile_avatar() { | |
if ( ! is_user_logged_in() ) { | |
return; | |
} | |
$user_id = get_current_user_id(); | |
if ( ! bp_get_user_has_avatar( $user_id ) && bp_current_action() != 'change-avatar' ) { |
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 yz_verified_users_count_shortcode( $atts = null ){ | |
global $wpdb; | |
// Get Args. | |
$args = shortcode_atts( | |
array( | |
'verified' => 'on', | |
), $atts, 'yz_verified_users_count' ); |
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 random_user_query( &$query ) | |
{ | |
$query->query_orderby = "ORDER BY RAND()"; | |
} | |
function display_random_vip_users( $atts ) { |
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 get_all_users_id_by_membership_level_id() { | |
$memberships = rcp_get_memberships( array( | |
'status' => 'active', | |
'object_id' => 2 // Membership Levels ID | |
) ); | |
foreach ($memberships as $membership) { |
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 | |
$countries = array ( | |
"افغانستان", | |
"جزایر آلند", | |
"آلبانی", | |
"الجزایر", | |
"ساموای آمریکا", | |
"آندورا", | |
"آنگولا", | |
"آنگویلا", |
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
// For more information you can see this url: https://developer.mozilla.org/en-US/docs/Web/API/URL | |
let parseUrl = (url) => { | |
let parser = document.createElement('a'); | |
parser.href = url; | |
return parser; | |
} | |
let url = parseUrl("http://username:[email protected]:3000/deploy/?search=test#hash"); | |
url.protocol; // => "http:" |
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 convert_activity_product_date_to_shamsi($args , $product){ | |
if( ! function_exists('parsidate') || get_locale() != 'fa_IR' ) { | |
return false; | |
} | |
$args['date'] = parsidate("Y-m-d", $product->get_date_created()->format( 'F j, Y' ), "per"); | |
return $args; |
OlderNewer