- Nome: Mario Rossi
- Email: mariorossi@email.com
- Ruolo: ...
- Requisiti fondamentali
| add_action( 'init', function () { | |
| // Registriamo un blocco interamente lato server. Niente block.json, niente JS. | |
| register_block_type( 'mavida/box-avviso', array( | |
| 'title' => 'Box avviso', | |
| 'category' => 'widgets', | |
| 'icon' => 'info', | |
| // Gli attributi definiti qui generano da soli i controlli nell'inspector: |
| #!/bin/sh | |
| if [ "$VIRTUALSERVER_ACTION" = "CREATE_DOMAIN" ]; then | |
| #printenv > /tempenv | |
| usermod -G vboxsf $VIRTUALSERVER_USER | |
| mkdir /media/sf_web/$VIRTUALSERVER_USER | |
| touch /media/sf_web/$VIRTUALSERVER_USER/index.html |
| /* | |
| * https://github.com/gulpjs/gulp | |
| * http://code.tutsplus.com/tutorials/using-gulp-for-wordpress-automation--cms-23081 | |
| * https://markgoodyear.com/2014/01/getting-started-with-gulp/ | |
| * http://mattbanks.me/gulp-wordpress-development/ | |
| * | |
| */ | |
| var gulp = require('gulp'), | |
| through = require('gulp-through'), |
| /* | |
| * http://www.denisbouquet.com/remove-wordpress-emoji-code/ | |
| * | |
| */ | |
| add_action( 'init', function(){ | |
| remove_action('wp_head', 'print_emoji_detection_script', 7); | |
| remove_action('wp_print_styles', 'print_emoji_styles'); |
| /* | |
| * @miziomon | |
| * Filter content by current user | |
| * | |
| */ | |
| add_filter('pre_get_posts', function ($query) { | |
| global $pagenow, $user_ID; | |
| if( !current_user_can('administrator') && $query->is_admin && 'upload.php' != $pagenow ){ | |
| $query->set('author', $user_ID); |
| <ifModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^(phpinfo|wp-signup|phpmyadmin|database|usage|cgi|signup|admin|register|timthumb|function|system|test|t|jsp|asp|aspx)$ blackhole/ [L] | |
| </ifModule> |
| # START Security settings | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^[custom-login-path]$ wp-login.php?loginkey=[key]&redirect_to=http://%{SERVER_NAME}/wp-admin/index.php [L] | |
| RewriteCond %{HTTP_REFERER} !^http://%{SERVER_NAME}/wp-admin | |
| RewriteCond %{HTTP_REFERER} !^http://%{SERVER_NAME}/wp-login\.php | |
| RewriteCond %{HTTP_REFERER} !^http://%{SERVER_NAME}/[custom-login-path] |
| /** | |
| * | |
| * redirect to homepage if has non "edit_posts" capabilities | |
| */ | |
| add_filter("admin_init", function () { | |
| if (!current_user_can('edit_posts')) { | |
| wp_redirect(WP_HOME); | |
| exit; |