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 | |
namespace AppBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\PasswordType; | |
use Symfony\Component\Form\Extension\Core\Type\RepeatedType; | |
use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
use Symfony\Component\Form\FormBuilderInterface; |
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
#### Backup web directories #### | |
cd /data/web/; for i in */; do tar -cvzf "${i%/}-$(date '+%Y%m%d').backupgd.tar.gz" "$i"; done; | |
find / -iname "*.backupgd.tar.gz" -exec mv {} /data/backups/web \; | |
#### Backup sql #### | |
sudo service mysql stop; | |
sudo mysqld_safe --skip-grant-tables & | |
cd /data/backups/sql; | |
for I in $(mysql -u root -e 'show databases'); do mysqldump -u root $I | gzip > "$I.sql.gz"; done; | |
#find . -type f -name '*.sql.gz' -exec mv {} /data/backups/sql \; |
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
# Default extension package | |
sudo apt-get install libxml2-dev libbz2-dev libmcrypt-dev libreadline-dev libxslt1-dev autoconf -y | |
# Default extension package (18.04) | |
sudo apt-get install libssl-dev | |
# +apxs2 | |
sudo apt-get install apache2-dev -y | |
# +gd (14.04) | |
sudo apt-get install -y libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev libjpeg8 libgd-dev libgd3 libwebp-dev |
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
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/new-name' ); |
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
define( 'WPMU_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/mu-plugins' ); |
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
define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/path/to/plugins' ); | |
define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/plugins' ); |
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
define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . 'path/to/wp-content' ); | |
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wp-content' ); |
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
define('ABSPATH', dirname(__FILE__) . '/'); | |
require_once(ABSPATH . '../path/to/wp-config.php'); |
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
add_action( 'pre_get_posts', 'set_posts_per_page' ); | |
function set_posts_per_page( $query ) { | |
global $wp_the_query; | |
if ( ( ! is_admin() ) && ( $query === $wp_the_query ) && ( $query->is_search() ) ) { | |
$query->set( 'posts_per_page', 3 ); | |
} | |
elseif ( ( ! is_admin() ) && ( $query === $wp_the_query ) && ( $query->is_archive() ) ) { | |
$query->set( 'posts_per_page', 5 ); |
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
# Visual Editor as default | |
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') ); | |
# HTML Editor as default | |
add_filter( 'wp_default_editor', create_function('', 'return "html";') ); |