├── README.md ├── add-dashboard-widget.sublime-snippet ├── custom-admin-logo.sublime-snippet ├── custom-footer-text.sublime-snippet ├── custom-login-logo.sublime-snippet ├── custom-login-url.sublime-snippet ├── custom-meta-boxes.sublime-snippet ├── custom-meta-boxes_pt-br.sublime-snippet ├── remove-dashboard-widgets.sublime-snippet ├── remove-screen-options.sublime-snippet └── wordpress-custom-admin.sublime-snippet /README.md: -------------------------------------------------------------------------------- 1 | SublimeText snippets 2 | ==================================== 3 | 4 | Contributors: [hugoassuncao](http://github.com/hugoassuncao) 5 | 6 | 7 | Description 8 | ----------- 9 | 10 | A collection of wordpress snippets for sublime text, to help save some time. 11 | The collection have the following snippets: 12 | 13 | 14 | * [custom-meta-boxes snippet](https://github.com/hugoassuncao/wordpress_snippets/blob/master/custom-meta-boxes.sublime-snippet) – it's a snippet for add [Tammy Hart's](https://github.com/tammyhart/Reusable-Custom-WordPress-Meta-Boxes) code for meta boxes. 15 | 16 | * [custom-meta-boxes_pt-br](https://github.com/hugoassuncao/wordpress_snippets/blob/master/custom-meta-boxes_pt-br.sublime-snippet) – is the brazilian portuguese version of Tammy's code. 17 | 18 | * [custom admin logo](https://github.com/hugoassuncao/wordpress_snippets/blob/master/custom-admin-logo.sublime-snippet) – allow you to change de admin logo 19 | 20 | * [custom login logo](https://github.com/hugoassuncao/wordpress_snippets/blob/master/custom-login-logo.sublime-snippet) – change the logo in the login screen 21 | 22 | * [custom login url](https://github.com/hugoassuncao/wordpress_snippets/blob/master/custom-login-url.sublime-snippet) – change the url of the logo in the login screen 23 | 24 | * [custom footer text](https://github.com/hugoassuncao/wordpress_snippets/blob/master/custom-footer-text.sublime-snippet) – add a custom text to admin footer 25 | 26 | * [remove dashboard widgets](https://github.com/hugoassuncao/wordpress_snippets/blob/master/remove-dashboard-widgets.sublime-snippet) – remove the unused dashboard widgets 27 | 28 | * [add custom dashboard widget](https://github.com/hugoassuncao/wordpress_snippets/blob/master/add-dashboard-widget.sublime-snippet) – add your custom dashboard widget 29 | 30 | * [remove screen options tab](https://github.com/hugoassuncao/wordpress_snippets/blob/master/remove-screen-options.sublime-snippet) – remove the 'screen options' tab from admi ui 31 | 32 | * [wordpress custom admin](https://github.com/hugoassuncao/wordpress_snippets/blob/master/wordpress-custom-admin.sublime-snippet) – a snippet that collects all the others, for customize your wordpress admin more quickly. -------------------------------------------------------------------------------- /add-dashboard-widget.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 |

Hello Wordpress user!

7 |

Fill this with HTML or PHP.

8 |
16 | 17 | dashwidget 18 | 19 | 20 | 21 | Add a custom dashboard widget 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /custom-admin-logo.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/${1:yout_file_name.png}) !important; } 8 | '; 9 | } 10 | add_action('admin_head', 'custom_admin_logo'); 11 | 12 | ]]> 13 | 14 | adminlogo 15 | 16 | 17 | 18 | Add a custom admin logo 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /custom-footer-text.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | footertxt 13 | 14 | 15 | 16 | Edit the footer text in wordpress admin area 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /custom-login-logo.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | h1 a { background-image:url('.get_bloginfo('template_directory').'/images/${1:yout_file_name.png}) !important; } 8 | '; 9 | } 10 | add_action('login_head', 'custom_login_logo'); 11 | 12 | ]]> 13 | 14 | loginlogo 15 | 16 | 17 | 18 | Add a custom logo to login screen 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /custom-login-url.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | loginurl 14 | 15 | 16 | 17 | Change the url of login logo 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /custom-meta-boxes.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 'Text Input', 21 | 'desc' => 'A description for the field.', 22 | 'id' => \$prefix.'text', 23 | 'type' => 'text' 24 | ), 25 | array( 26 | 'label' => 'Textarea', 27 | 'desc' => 'A description for the field.', 28 | 'id' => \$prefix.'textarea', 29 | 'type' => 'textarea' 30 | ), 31 | array( 32 | 'label' => 'Checkbox Input', 33 | 'desc' => 'A description for the field.', 34 | 'id' => \$prefix.'checkbox', 35 | 'type' => 'checkbox' 36 | ), 37 | array( 38 | 'label' => 'Select Box', 39 | 'desc' => 'A description for the field.', 40 | 'id' => \$prefix.'select', 41 | 'type' => 'select', 42 | 'options' => array ( 43 | 'one' => array ( 44 | 'label' => 'Option One', 45 | 'value' => 'one' 46 | ), 47 | 'two' => array ( 48 | 'label' => 'Option Two', 49 | 'value' => 'two' 50 | ), 51 | 'three' => array ( 52 | 'label' => 'Option Three', 53 | 'value' => 'three' 54 | ) 55 | ) 56 | ), 57 | array ( 58 | 'label' => 'Radio Group', 59 | 'desc' => 'A description for the field.', 60 | 'id' => \$prefix.'radio', 61 | 'type' => 'radio', 62 | 'options' => array ( 63 | 'one' => array ( 64 | 'label' => 'Option One', 65 | 'value' => 'one' 66 | ), 67 | 'two' => array ( 68 | 'label' => 'Option Two', 69 | 'value' => 'two' 70 | ), 71 | 'three' => array ( 72 | 'label' => 'Option Three', 73 | 'value' => 'three' 74 | ) 75 | ) 76 | ), 77 | array ( 78 | 'label' => 'Checkbox Group', 79 | 'desc' => 'A description for the field.', 80 | 'id' => \$prefix.'checkbox_group', 81 | 'type' => 'checkbox_group', 82 | 'options' => array ( 83 | 'one' => array ( 84 | 'label' => 'Option One', 85 | 'value' => 'one' 86 | ), 87 | 'two' => array ( 88 | 'label' => 'Option Two', 89 | 'value' => 'two' 90 | ), 91 | 'three' => array ( 92 | 'label' => 'Option Three', 93 | 'value' => 'three' 94 | ) 95 | ) 96 | ), 97 | array( 98 | 'label' => 'Category', 99 | 'id' => 'category', 100 | 'type' => 'tax_select' 101 | ), 102 | array( 103 | 'label' => 'Post List', 104 | 'desc' => 'A description for the field.', 105 | 'id' => \$prefix.'post_id', 106 | 'type' => 'post_list', 107 | 'post_type' => array('post','page') 108 | ), 109 | array( 110 | 'label' => 'Date', 111 | 'desc' => 'A description for the field.', 112 | 'id' => \$prefix.'date', 113 | 'type' => 'date' 114 | ), 115 | array( 116 | 'label' => 'Slider', 117 | 'desc' => 'A description for the field.', 118 | 'id' => \$prefix.'slider', 119 | 'type' => 'slider', 120 | 'min' => '0', 121 | 'max' => '100', 122 | 'step' => '5' 123 | ), 124 | array( 125 | 'label' => 'Image', 126 | 'desc' => 'A description for the field.', 127 | 'id' => \$prefix.'image', 128 | 'type' => 'image' 129 | ), 130 | array( 131 | 'label' => 'Repeatable', 132 | 'desc' => 'A description for the field.', 133 | 'id' => \$prefix.'repeatable', 134 | 'type' => 'repeatable' 135 | ) 136 | ); 137 | 138 | // enqueue scripts and styles, but only if is_admin 139 | if(is_admin()) { 140 | wp_enqueue_script('jquery-ui-datepicker'); 141 | wp_enqueue_script('jquery-ui-slider'); 142 | wp_enqueue_script('custom-js', get_template_directory_uri().'/js/custom-js.js'); 143 | wp_enqueue_style('jquery-ui-custom', get_template_directory_uri().'/css/jquery-ui-custom.css'); 144 | } 145 | 146 | // add some custom js to the head of the page 147 | add_action('admin_head','add_custom_scripts'); 148 | function add_custom_scripts() { 149 | global \$${1:custom_meta}_fields, \$post; 150 | 151 | \$output = ''; 177 | 178 | echo \$output; 179 | } 180 | 181 | // The Callback 182 | function show_${1:custom_meta}_box() { 183 | global \$${1:custom_meta}_fields, \$post; 184 | // Use nonce for verification 185 | echo ''; 186 | 187 | // Begin the field table and loop 188 | echo ''; 189 | foreach (\$${1:custom_meta}_fields as \$field) { 190 | // get value of this field if it exists for this post 191 | \$meta = get_post_meta(\$post->ID, \$field['id'], true); 192 | // begin a table row with 193 | echo ' 194 | 195 | '; 309 | } // end foreach 310 | echo '
'; 196 | switch(\$field['type']) { 197 | // text 198 | case 'text': 199 | echo ' 200 |
'.\$field['desc'].''; 201 | break; 202 | // textarea 203 | case 'textarea': 204 | echo ' 205 |
'.\$field['desc'].''; 206 | break; 207 | // checkbox 208 | case 'checkbox': 209 | echo ' 210 | '; 211 | break; 212 | // select 213 | case 'select': 214 | echo '
'.\$field['desc'].''; 219 | break; 220 | // radio 221 | case 'radio': 222 | foreach ( \$field['options'] as \$option ) { 223 | echo ' 224 |
'; 225 | } 226 | echo ''.\$field['desc'].''; 227 | break; 228 | // checkbox_group 229 | case 'checkbox_group': 230 | foreach (\$field['options'] as \$option) { 231 | echo ' 232 |
'; 233 | } 234 | echo ''.\$field['desc'].''; 235 | break; 236 | // tax_select 237 | case 'tax_select': 238 | echo '
Manage '.\$taxonomy->label.''; 250 | break; 251 | // post_list 252 | case 'post_list': 253 | \$items = get_posts( array ( 254 | 'post_type' => \$field['post_type'], 255 | 'posts_per_page' => -1 256 | )); 257 | echo '
'.\$field['desc'].''; 263 | break; 264 | // date 265 | case 'date': 266 | echo ' 267 |
'.\$field['desc'].''; 268 | break; 269 | // slider 270 | case 'slider': 271 | \$value = \$meta != '' ? \$meta : '0'; 272 | echo '
273 | 274 |
'.\$field['desc'].''; 275 | break; 276 | // image 277 | case 'image': 278 | \$image = get_template_directory_uri().'/images/image.png'; 279 | echo ''; 280 | if (\$meta) { \$image = wp_get_attachment_image_src(\$meta, 'medium'); \$image = \$image[0]; } 281 | echo ' 282 |
283 | 284 |  Remove Image 285 |
'.\$field['desc'].''; 286 | break; 287 | // repeatable 288 | case 'repeatable': 289 | echo '+ 290 |
    '; 291 | \$i = 0; 292 | if (\$meta) { 293 | foreach(\$meta as \$row) { 294 | echo '
  • ||| 295 | 296 | -
  • '; 297 | \$i++; 298 | } 299 | } else { 300 | echo '
  • ||| 301 | 302 | -
  • '; 303 | } 304 | echo '
305 | '.\$field['desc'].''; 306 | break; 307 | } //end switch 308 | echo '
'; // end table 311 | } 312 | 313 | function ${1:custom_meta}_remove_taxonomy_boxes() { 314 | remove_meta_box('categorydiv', 'post', 'side'); 315 | } 316 | add_action( 'admin_menu' , '${1:custom_meta}_remove_taxonomy_boxes' ); 317 | 318 | // Save the Data 319 | function save_${1:custom_meta}(\$post_id) { 320 | global \$${1:custom_meta}_fields; 321 | 322 | // verify nonce 323 | if (!wp_verify_nonce(\$_POST['${1:custom_meta}_box_nonce'], basename(__FILE__))) 324 | return \$post_id; 325 | // check autosave 326 | if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) 327 | return \$post_id; 328 | // check permissions 329 | if ('page' == \$_POST['post_type']) { 330 | if (!current_user_can('edit_page', \$post_id)) 331 | return \$post_id; 332 | } elseif (!current_user_can('edit_post', \$post_id)) { 333 | return \$post_id; 334 | } 335 | 336 | // loop through fields and save the data 337 | foreach (\$${1:custom_meta}_fields as \$field) { 338 | if(\$field['type'] == 'tax_select') continue; 339 | \$old = get_post_meta(\$post_id, \$field['id'], true); 340 | \$new = \$_POST[\$field['id']]; 341 | if (\$new && \$new != \$old) { 342 | update_post_meta(\$post_id, \$field['id'], \$new); 343 | } elseif ('' == \$new && \$old) { 344 | delete_post_meta(\$post_id, \$field['id'], \$old); 345 | } 346 | } // enf foreach 347 | 348 | // save taxonomies 349 | \$post = get_post(\$post_id); 350 | \$category = \$_POST['category']; 351 | wp_set_object_terms( \$post_id, \$category, 'category' ); 352 | } 353 | add_action('save_post', 'save_${1:custom_meta}'); 354 | 355 | 356 | ]]>
357 | 358 | metaboxes 359 | 360 | 361 | 362 | Create custom meta boxes using the Tammy's Hart system, available at https://github.com/tammyhart/Reusable-Custom-WordPress-Meta-Boxes 363 |
364 | 365 | 366 | -------------------------------------------------------------------------------- /custom-meta-boxes_pt-br.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 'Text Input', 21 | 'desc' => 'Uma descrição para o campo.', 22 | 'id' => \$prefix.'text', 23 | 'type' => 'text' 24 | ), 25 | array( 26 | 'label' => 'Textarea', 27 | 'desc' => 'Uma descrição para o campo.', 28 | 'id' => \$prefix.'textarea', 29 | 'type' => 'textarea' 30 | ), 31 | array( 32 | 'label' => 'Checkbox Input', 33 | 'desc' => 'Uma descrição para o campo.', 34 | 'id' => \$prefix.'checkbox', 35 | 'type' => 'checkbox' 36 | ), 37 | array( 38 | 'label' => 'Select Box', 39 | 'desc' => 'Uma descrição para o campo.', 40 | 'id' => \$prefix.'select', 41 | 'type' => 'select', 42 | 'options' => array ( 43 | 'one' => array ( 44 | 'label' => 'Option One', 45 | 'value' => 'one' 46 | ), 47 | 'two' => array ( 48 | 'label' => 'Option Two', 49 | 'value' => 'two' 50 | ), 51 | 'three' => array ( 52 | 'label' => 'Option Three', 53 | 'value' => 'three' 54 | ) 55 | ) 56 | ), 57 | array ( 58 | 'label' => 'Radio Group', 59 | 'desc' => 'Uma descrição para o campo.', 60 | 'id' => \$prefix.'radio', 61 | 'type' => 'radio', 62 | 'options' => array ( 63 | 'one' => array ( 64 | 'label' => 'Option One', 65 | 'value' => 'one' 66 | ), 67 | 'two' => array ( 68 | 'label' => 'Option Two', 69 | 'value' => 'two' 70 | ), 71 | 'three' => array ( 72 | 'label' => 'Option Three', 73 | 'value' => 'three' 74 | ) 75 | ) 76 | ), 77 | array ( 78 | 'label' => 'Checkbox Group', 79 | 'desc' => 'Uma descrição para o campo.', 80 | 'id' => \$prefix.'checkbox_group', 81 | 'type' => 'checkbox_group', 82 | 'options' => array ( 83 | 'one' => array ( 84 | 'label' => 'Option One', 85 | 'value' => 'one' 86 | ), 87 | 'two' => array ( 88 | 'label' => 'Option Two', 89 | 'value' => 'two' 90 | ), 91 | 'three' => array ( 92 | 'label' => 'Option Three', 93 | 'value' => 'three' 94 | ) 95 | ) 96 | ), 97 | array( 98 | 'label' => 'Category', 99 | 'id' => 'category', 100 | 'type' => 'tax_select' 101 | ), 102 | array( 103 | 'label' => 'Post List', 104 | 'desc' => 'Uma descrição para o campo.', 105 | 'id' => \$prefix.'post_id', 106 | 'type' => 'post_list', 107 | 'post_type' => array('post','page') 108 | ), 109 | array( 110 | 'label' => 'Date', 111 | 'desc' => 'Uma descrição para o campo.', 112 | 'id' => \$prefix.'date', 113 | 'type' => 'date' 114 | ), 115 | array( 116 | 'label' => 'Slider', 117 | 'desc' => 'Uma descrição para o campo.', 118 | 'id' => \$prefix.'slider', 119 | 'type' => 'slider', 120 | 'min' => '0', 121 | 'max' => '100', 122 | 'step' => '5' 123 | ), 124 | array( 125 | 'label' => 'Image', 126 | 'desc' => 'Uma descrição para o campo.', 127 | 'id' => \$prefix.'image', 128 | 'type' => 'image' 129 | ), 130 | array( 131 | 'label' => 'Repeatable', 132 | 'desc' => 'Uma descrição para o campo.', 133 | 'id' => \$prefix.'repeatable', 134 | 'type' => 'repeatable' 135 | ) 136 | ); 137 | 138 | // enqueue scripts and styles, but only if is_admin 139 | if(is_admin()) { 140 | wp_enqueue_script('jquery-ui-datepicker'); 141 | wp_enqueue_script('jquery-ui-slider'); 142 | wp_enqueue_script('custom-js', get_template_directory_uri().'/js/custom-js.js'); 143 | wp_enqueue_style('jquery-ui-custom', get_template_directory_uri().'/css/jquery-ui-custom.css'); 144 | } 145 | 146 | // add some custom js to the head of the page 147 | add_action('admin_head','add_custom_scripts'); 148 | function add_custom_scripts() { 149 | global \$${1:custom_meta}_fields, \$post; 150 | 151 | \$output = ''; 177 | 178 | echo \$output; 179 | } 180 | 181 | // The Callback 182 | function show_${1:custom_meta}_box() { 183 | global \$${1:custom_meta}_fields, \$post; 184 | // Use nonce for verification 185 | echo ''; 186 | 187 | // Begin the field table and loop 188 | echo ''; 189 | foreach (\$${1:custom_meta}_fields as \$field) { 190 | // get value of this field if it exists for this post 191 | \$meta = get_post_meta(\$post->ID, \$field['id'], true); 192 | // begin a table row with 193 | echo ' 194 | 195 | '; 309 | } // end foreach 310 | echo '
'; 196 | switch(\$field['type']) { 197 | // text 198 | case 'text': 199 | echo ' 200 |
'.\$field['desc'].''; 201 | break; 202 | // textarea 203 | case 'textarea': 204 | echo ' 205 |
'.\$field['desc'].''; 206 | break; 207 | // checkbox 208 | case 'checkbox': 209 | echo ' 210 | '; 211 | break; 212 | // select 213 | case 'select': 214 | echo '
'.\$field['desc'].''; 219 | break; 220 | // radio 221 | case 'radio': 222 | foreach ( \$field['options'] as \$option ) { 223 | echo ' 224 |
'; 225 | } 226 | echo ''.\$field['desc'].''; 227 | break; 228 | // checkbox_group 229 | case 'checkbox_group': 230 | foreach (\$field['options'] as \$option) { 231 | echo ' 232 |
'; 233 | } 234 | echo ''.\$field['desc'].''; 235 | break; 236 | // tax_select 237 | case 'tax_select': 238 | echo '
Manage '.\$taxonomy->label.''; 250 | break; 251 | // post_list 252 | case 'post_list': 253 | \$items = get_posts( array ( 254 | 'post_type' => \$field['post_type'], 255 | 'posts_per_page' => -1 256 | )); 257 | echo '
'.\$field['desc'].''; 263 | break; 264 | // date 265 | case 'date': 266 | echo ' 267 |
'.\$field['desc'].''; 268 | break; 269 | // slider 270 | case 'slider': 271 | \$value = \$meta != '' ? \$meta : '0'; 272 | echo '
273 | 274 |
'.\$field['desc'].''; 275 | break; 276 | // image 277 | case 'image': 278 | \$image = get_template_directory_uri().'/images/image.png'; 279 | echo ''; 280 | if (\$meta) { \$image = wp_get_attachment_image_src(\$meta, 'medium'); \$image = \$image[0]; } 281 | echo ' 282 |
283 | 284 |  Remover imagem 285 |
'.\$field['desc'].''; 286 | break; 287 | // repeatable 288 | case 'repeatable': 289 | echo '+ 290 |
    '; 291 | \$i = 0; 292 | if (\$meta) { 293 | foreach(\$meta as \$row) { 294 | echo '
  • ||| 295 | 296 | -
  • '; 297 | \$i++; 298 | } 299 | } else { 300 | echo '
  • ||| 301 | 302 | -
  • '; 303 | } 304 | echo '
305 | '.\$field['desc'].''; 306 | break; 307 | } //end switch 308 | echo '
'; // end table 311 | } 312 | 313 | function ${1:custom_meta}_remove_taxonomy_boxes() { 314 | remove_meta_box('categorydiv', 'post', 'side'); 315 | } 316 | add_action( 'admin_menu' , 'remove_taxonomy_boxes' ); 317 | 318 | // Save the Data 319 | function save_${1:custom_meta}(\$post_id) { 320 | global \$${1:custom_meta}_fields; 321 | 322 | // verify nonce 323 | if (!wp_verify_nonce(\$_POST['${1:custom_meta}_box_nonce'], basename(__FILE__))) 324 | return \$post_id; 325 | // check autosave 326 | if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) 327 | return \$post_id; 328 | // check permissions 329 | if ('page' == \$_POST['post_type']) { 330 | if (!current_user_can('edit_page', \$post_id)) 331 | return \$post_id; 332 | } elseif (!current_user_can('edit_post', \$post_id)) { 333 | return \$post_id; 334 | } 335 | 336 | // loop through fields and save the data 337 | foreach (\$${1:custom_meta}_fields as \$field) { 338 | if(\$field['type'] == 'tax_select') continue; 339 | \$old = get_post_meta(\$post_id, \$field['id'], true); 340 | \$new = \$_POST[\$field['id']]; 341 | if (\$new && \$new != \$old) { 342 | update_post_meta(\$post_id, \$field['id'], \$new); 343 | } elseif ('' == \$new && \$old) { 344 | delete_post_meta(\$post_id, \$field['id'], \$old); 345 | } 346 | } // enf foreach 347 | 348 | // save taxonomies 349 | \$post = get_post(\$post_id); 350 | \$category = \$_POST['category']; 351 | wp_set_object_terms( \$post_id, \$category, 'category' ); 352 | } 353 | add_action('save_post', 'save_${1:custom_meta}'); 354 | 355 | 356 | ]]>
357 | 358 | mtbx 359 | 360 | 361 | 362 | Create custom meta boxes using the Tammy's Hart system, available at https://github.com/tammyhart/Reusable-Custom-WordPress-Meta-Boxes 363 |
364 | 365 | 366 | -------------------------------------------------------------------------------- /remove-dashboard-widgets.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | dashwidgetout 21 | 22 | 23 | 24 | Remove the dashboard widgets 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /remove-screen-options.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | screenoptout 11 | 12 | 13 | 14 | Edit the footer text in wordpress admin area 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wordpress-custom-admin.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 15 | h1 a { background-image:url('.get_bloginfo('template_directory').'/images/${2:yout_file_name.png}) !important; } 16 | '; 17 | } 18 | add_action('login_head', 'custom_login_logo'); 19 | 20 | 21 | /// add a custom admin logo 22 | function custom_admin_logo() { 23 | echo ''; 26 | } 27 | add_action('admin_head', 'custom_admin_logo'); 28 | 29 | 30 | /// custom footer text 31 | function remove_footer_admin () { 32 | echo '${4:insert your custom text}.'; 33 | } 34 | add_filter('admin_footer_text', 'remove_footer_admin'); 35 | 36 | 37 | /// remove unused dashboard widgets 38 | function remove_dashboard_widgets() { 39 | global \$wp_meta_boxes; 40 | unset(\$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); 41 | unset(\$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); 42 | unset(\$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); 43 | unset(\$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); 44 | unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); 45 | unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); 46 | unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); 47 | unset(\$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); 48 | } 49 | add_action('wp_dashboard_setup', 'remove_dashboard_widgets' ); 50 | 51 | 52 | /// add a custom dashboard widget 53 | function ${5:your_dashboard_widget}() { ?> 54 |

Hello Wordpress user!

55 |

Fill this with HTML or PHP.

56 |
68 | 69 | customadmin 70 | 71 | 72 | 73 | Change the appearance of wordpress admin ui 74 |
75 | 76 | 77 | --------------------------------------------------------------------------------