Skip to content

Instantly share code, notes, and snippets.

View adansuku's full-sized avatar
🏠
Working from home

adansuku

🏠
Working from home
View GitHub Profile
@adansuku
adansuku / Allow everyone to upload profile registration pages.txt
Created March 31, 2021 20:20 — forked from rifkyfu32/Allow everyone to upload profile registration pages.txt
Customization allow everyone to upload profile on registration pages - Ultimate Member 2.0 +
1.Copy the bellow code in your theme's function.php file. Should be in public_html/wp-content/themes/your-themes-name/function.php
/**
* Ultimate Member 2.0 - Customization
* Description: Allow everyone to upload profile registration pages.
*/
add_filter("um_user_pre_updating_files_array","um_custom_user_pre_updating_files_array", 10, 1);
function um_custom_user_pre_updating_files_array( $arr_files ){
if( is_array( $arr_files ) ){
@adansuku
adansuku / default month.php
Created May 7, 2020 13:24 — forked from theeventscalendar/default month.php
Show a default month or date range in the calendar
<?php
/**
* Sets the default date for event queries.
*
* Expects to be called during tribe_events_pre_get_posts. Note that this
* function modifies $_REQUEST - this is needed for consistency because
* various parts of TEC inspect that array directly to determine the current
* date.
*
@adansuku
adansuku / cpt-to-cpt.php
Created March 31, 2020 12:10 — forked from HarishChaudhari/cpt-to-cpt.php
Copy posts from one Custom Post Type to another. (It doesn't handle post attachments for now)
<?php
add_action('admin_init', 'foo_duplicate_posts', 99999);
function foo_duplicate_posts(){
// Only allow admins to run the script
if(!current_user_can('manage_options'))
return;
// Check if keyword is set
if(!isset($_GET['duplicate-posts']))