PHP

CSS

JS

WordPress

developer.php

>

>

>
custom_functions.php

/**/

 


<?php
/**
 * Plugin Name: YLDist Custom Functions
 * Plugin URI: http://YLDIST.COM
 * Description: Functions and edits.
 * Author: JPowersFreelancing
 * Author URI: http://YLDIST.COM
 * Version: 1.0
 */

/* Place custom code below this line. */
add_action( 'admin_enqueue_scripts', 'enqueue_admin' );
//disable WordPress sanitization to allow more than just $allowedtags from /wp-includes/kses.php
remove_filter('pre_user_description', 'wp_filter_kses');
//add sanitization for WordPress posts
add_filter( 'pre_user_description', 'wp_filter_post_kses');

//add_action('init', 'change_permalinks', 20);
//function change_permalinks() {
//    global $wp_rewrite;
//    $wp_rewrite->set_permalink_structure('/%postname%/');
//    $wp_rewrite->flush_rules();
//}

function hide_personal_options(){
echo "\n" . '<script type="text/javascript">jQuery(document).ready(function($) { $(\'form#your-profile > h3:first\').hide(); $(\'form#your-profile > table:first\').hide(); $(\'form#your-profile\').show(); });</script>' . "\n";
}
add_action('admin_head','hide_personal_options');

// CHANGE EMAILS
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');

function new_mail_from($old) {
 return 'no-reply@yldist.com';
}
function new_mail_from_name($old) {
 return 'YLDist';
}
//============
add_action( 'signup_extra_fields', 'append_confirm_email' );
function append_confirm_email() {
	?>
	<div class="email-confirm">
		<label for="confirm_email">Confirm Email:</label>
		<input type="email" maxlength="200" value=""
		       id="confirm_email" name="confirm_email"><br>
	</div>
	<?php
}
//============
global $removeemailverification;
remove_filter('wpmu_signup_blog_notification', array($removeemailverification, 'activate_on_blog_signup'));

add_filter('wpmu_signup_blog_notification', 'custom_activate_on_blog_signup', 10, 7 );
function custom_activate_on_blog_signup( $domain, $path, $title, $user, $user_email, $key, $meta ){
	
	$subsyl = 'https://yldist.com/distributor/';

    // Rather than recreate the wheel, just activate the blog immediately
    $result = wpmu_activate_signup($key);

	wp_redirect( $subsyl );  // Change the redirection URL here

	exit;
}

function remove_customizer_settings( $wp_customize ){
if ( is_super_admin() ) {
	
} else {
	$wp_customize->remove_panel('widgets'); // ok
	$wp_customize->remove_panel('nav_menus');
	$wp_customize->remove_section('themes');
}
}
add_action( 'customize_register', 'remove_customizer_settings', 20 );

//============
function remove_core_updates(){
if ( is_super_admin() ) {
	
} else {
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
add_filter('pre_site_transient_update_core','remove_core_updates');
add_filter('pre_site_transient_update_plugins','remove_core_updates');
add_filter('pre_site_transient_update_themes','remove_core_updates');
}
}
?>
I'm a Developer,
About Me
this is my portfolio
Skip to Work
BOLD DESIGN CHOICES
I make those.