Replace logo in admin bar

/* Replace logo in admin bar */ add_action(‘wp_before_admin_bar_render’, ‘rd_admin_bar_logo’); function rd_admin_bar_logo() { global $wp_admin_bar; echo ‘ ‘; }Continue reading

Add contact info box onto Dashboard

/* Add contact info box onto Dashboard */ add_action(‘wp_dashboard_setup’, ‘rd_support_widget’ ); function rd_support_widget() { wp_add_dashboard_widget(‘wp_dashboard_widget’, ‘Support Information’, ‘rd_support_info’); } function rd_support_info() { echo ” Website support For website support, maintenance and further developments contact Rubber Duckers at [email protected] “; }Continue reading

Remove image link from media uploads

/* Remove image link from media uploads */ function wpb_imagelink_setup() { $image_set = get_option( ‘image_default_link_type’ ); if ($image_set !== ‘none’) { update_option(‘image_default_link_type’, ‘none’); } } add_action(‘admin_init’, ‘wpb_imagelink_setup’, 10);Continue reading

Disable WordPress image compression

// Disable image compression add_filter( ‘jpeg_quality’, ‘smashing_jpeg_quality’ ); function smashing_jpeg_quality() { return 100; } // Disable image scaling add_filter( ‘big_image_size_threshold’, ‘__return_false’ );Continue reading

Replace Hi Greeting AND Comma

// Replace Hi Greeting AND Comma function replace_hi_greeting($wp_admin_bar) { $my_account=$wp_admin_bar->get_node(‘my-account’); $newtitle = str_replace(‘Hi,’, ”, $my_account->title ); $wp_admin_bar->add_node(array( ‘id’ => ‘my-account’, ‘title’ => $newtitle, ) ); } add_filter(‘admin_bar_menu’, ‘replace_hi_greeting’,12);Continue reading

Rubber Duckers maintenance menu

// Custom links in Admin bar add_action(‘admin_bar_menu’, ‘add_toolbar_items’, 60); function add_toolbar_items($admin_bar){ $admin_bar->add_menu( array( ‘id’ => ‘Rubber Duckers’, ‘title’ => ‘Rubber Duckers’, ‘href’ => ‘#’, ‘meta’ => array( ‘title’ => __(‘Rubber Duckers’), ), )); $admin_bar->add_menu( array( ‘id’ => ‘Website’, ‘parent’ =>…Continue reading

create_folder_and_upload_file

function create_custom_directory($dir_name) { $upload_dir = wp_upload_dir(); // Get the uploads directory array $custom_dir = $upload_dir[‘basedir’] . ‘/’ . $dir_name; // Specify the custom folder if (!file_exists($custom_dir)) { wp_mkdir_p($custom_dir); if(file_exists($custom_dir)) { return “Directory created successfully.”; } else { return “Failed to…Continue reading