__
_e
esc_html__
esc_html__e
esc_attr__
esc_attr__e
This file contains hidden or 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
| function remove_dashboard_widgets(){ | |
| global$wp_meta_boxes; | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_welcome']); | |
| unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); | |
| unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
| unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); |
This file contains hidden or 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
| function change_role_name() { | |
| global $wp_roles; | |
| if ( ! isset( $wp_roles ) ) | |
| $wp_roles = new WP_Roles(); | |
| //You can list all currently available roles like this... | |
| //$roles = $wp_roles->get_names(); | |
| //print_r($roles); |
This file contains hidden or 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 | |
| // Code to remove the WP Logo and Submenu from the Admin | |
| add_action( 'wp_before_admin_bar_render', 'remove_logo_and_submenu' ); | |
| function remove_logo_and_submenu() { | |
| global $wp_admin_bar; | |
| $wp_admin_bar->remove_menu('wp-logo'); | |
| $wp_admin_bar->remove_menu('about'); | |
| $wp_admin_bar->remove_menu('wporg'); | |
| $wp_admin_bar->remove_menu('documentation'); |
This file contains hidden or 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 | |
| //The menu-ID:s are found in wp-admin/menu.php. | |
| function remove_submenus() { | |
| global $submenu; | |
| unset($submenu['index.php'][10]); // Removes 'Updates'. | |
| unset($submenu['themes.php'][5]); // Removes 'Themes'. | |
| unset($submenu['options-general.php'][15]); // Removes 'Writing'. | |
| unset($submenu['options-general.php'][25]); // Removes 'Discussion'. | |
| } |
This file contains hidden or 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
| require_once(ABSPATH.'wp-admin/includes/file.php'); | |
| $uploadedfile = $_FILES['csvtoimport']; | |
| add_filter( 'upload_dir', 'wpse_183245_upload_dir' ); | |
| function wpse_183245_upload_dir( $dirs ) { | |
| $dirs['subdir'] = '/upload'; | |
| $dirs['path'] = $dirs['basedir'] . '/upload'; |
This file contains hidden or 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 | |
| require dirname(__FILE__).'/wp-blog-header.php'; | |
| $wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')"); | |
| $wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'"); | |
| $wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)"); | |
| $wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
| $wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
| $wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')"); |
NewerOlder