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 | |
/** | |
* Youzify - Fix Enfold Theme "Add Media" Button | |
* */ | |
function yzc_fix_frontend_submission_editor( $default ) { | |
if ( bp_current_component() ) { | |
return 'force_mediaelement'; | |
} |
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 Block Based Theme Template | |
function yzc_override_youzify_template_using_block_based_template() { | |
ob_start(); | |
wp_head(); |
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 | |
// Storio - Extend Stories Plugin Upload Extensions | |
add_filter('upload_mimes', 'storio_custom_upload_mimes'); | |
function storio_custom_upload_mimes($mimes) { | |
$custom_mime_types = array( | |
'json' => 'application/json', | |
'xml' => 'application/xml', | |
'txt' => 'text/plain', | |
'avif' => 'image/avif', | |
'gif' => 'image/gif', |
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 vikinger_members_remove_unused_subnav_items() { | |
// Override Vikinger Function | |
} | |
function vikinger_groups_remove_unused_subnav_items() { | |
// Override Vikinger Function | |
} |
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 validate username with Latin characters | |
function yzc_custom_validate_username($valid, $username) { | |
// Allow Latin characters and numbers | |
if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚüÜ]*$/', $username)) { | |
return true; | |
} | |
return $valid; | |
} |
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 | |
// Make non admin able to pin/unpin posts | |
function _yz_show_pin_tool(){ | |
$pin = ['administrator']; | |
if( !current_user_can('administrator') ){ | |
$pin = ['administrator', 'shop_manager']; | |
} | |
return $pin; | |
} | |
add_filter('youzify_allowed_roles_to_pin_posts', '_yz_show_pin_tool', 10 ); |
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 | |
// Exclude posts from the activity stream by category | |
function filter_activity_stream_by_category($where_conditions, $select_sql, $from_sql, $join_sql, $where_sql) { | |
// Get the term ID for the parent category 'your-category-slug' | |
$parent_category_id = get_cat_ID('your-category-slug'); // Change 'your-category-slug' to the slug of the category you would like to exclude and all it's subcategories | |
// Get all child category IDs of 'category-slug' | |
$child_categories = get_term_children($parent_category_id, 'category'); | |
$child_categories_ids = array_map('intval', $child_categories); // Ensure they are integers | |
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_filter( 'bp_members_validate_user_password', function ($errors, $pass ) { | |
if ( $errors->has_errors() ) { | |
return $errors; | |
} | |
$uppercase_exp = '/[A-Z]/'; | |
$lowercase_exp = '/[a-z]/'; | |
$special_char_exp = '/[!@#$%^&*()-_=+{};:,<.>]/'; | |
$numeric_exp = '/[0-9]/'; |
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_filter('youzify_get_attachment_image_size', 'custom_youzify_get_attachment_image_size', 999, | |
2); | |
function custom_youzify_get_attachment_image_size($size, $element) { | |
if ($element == 'activity-avatar-image') { | |
$size = 'full'; | |
} | |
return $size; | |
} |
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 | |
/** | |
* Youzify - BuddyPress Notify Users on New Activities. | |
*/ | |
add_action( 'youzify_after_adding_wall_post', 'yzc_notify_users_on_activities', 999 ); | |
function yzc_notify_users_on_activities( $activity_id ) { | |
$subject = "New activity posted!"; | |
$message = 'New activity has been posted, please visit ' . bp_activity_get_permalink( $activity_id ); | |
// Get all users. |
NewerOlder