This file contains 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
#!/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 |
This file contains 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
/* | |
* 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'), |
This file contains 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
/* | |
* 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'); |
This file contains 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
/* | |
* @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); |
This file contains 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
<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> |
This file contains 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
# 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] |
This file contains 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
/** | |
* | |
* 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; |
This file contains 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 | |
/** | |
* | |
* Template Name: Restricted Area | |
* | |
*/ | |
if( !is_user_logged_in() ) { | |
wp_redirect( WP_HOME ); // redirect to home |
This file contains 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
/** | |
* first relase | |
* fix to get and translate comment error message | |
* | |
*/ | |
add_action("pre_comment_on_post", function( $comment_post_ID) { | |
$comment_author = ( isset($_POST['author']) ) ? trim(strip_tags($_POST['author'])) : null; | |
$comment_author_email = ( isset($_POST['email']) ) ? trim($_POST['email']) : null; |
This file contains 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 | |
add_action('wp_ajax_morepage', 'morepage'); | |
add_action('wp_ajax_nopriv_morepage', 'morepage'); | |
/** | |
* | |
* posts_per_page have to set with your pagination value | |
**/ |
NewerOlder