#Mysql: Backup and Restore
Mysql Backup and restore through command line.
mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
mysqldump -u root -p --all-databases > alldb.sql
| <?php | |
| function tb_get_previous_post_link(){ | |
| global $post; | |
| $prev_link = ""; | |
| $prev_post = get_previous_post(); | |
| if($prev_post){ | |
| $prev_link = get_the_permalink($prev_post->ID); | |
| } | |
| return $prev_link; | |
| } |
| <?php | |
| function init_url_rewrite_rule(){ | |
| add_rewrite_endpoint( 'edit',EP_PERMALINK | EP_PAGES | EP_ATTACHMENT ); | |
| if(get_option("EDIT_REWRITE_RULE")!=1){ | |
| flush_rewrite_rules(); | |
| update_option("EDIT_REWRITE_RULE",1); | |
| } | |
| } | |
| function redirect_edit_url(){ |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
| */ | |
| $args = array( |
| <IfModule mod_setenvif.c> | |
| <IfModule mod_headers.c> | |
| <FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$"> | |
| SetEnvIf Origin ":" IS_CORS | |
| Header set Access-Control-Allow-Origin "*" env=IS_CORS | |
| </FilesMatch> | |
| </IfModule> | |
| </IfModule> | |
| <IfModule mod_headers.c> |
| /* | |
| * custom pagination with bootstrap .pagination class | |
| * source: http://www.ordinarycoder.com/paginate_links-class-ul-li-bootstrap/ | |
| */ | |
| function bootstrap_pagination( $echo = true ) { | |
| global $wp_query; | |
| $big = 999999999; // need an unlikely integer | |
| $pages = paginate_links( array( |
| function custom_pagination() { | |
| global $wp_query; | |
| $big = 999999999; // need an unlikely integer | |
| $pages = paginate_links( array( | |
| 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
| 'format' => '?paged=%#%', | |
| 'current' => max( 1, get_query_var('paged') ), | |
| 'total' => $wp_query->max_num_pages, | |
| 'prev_next' => false, | |
| 'type' => 'array', |