Changeset 2547511
- Timestamp:
- 06/14/2021 01:50:48 PM (5 years ago)
- Location:
- wp2html
- Files:
-
- 13 added
- 5 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/assets (added)
-
tags/1.0.2/assets/admin.css (added)
-
tags/1.0.2/classes (added)
-
tags/1.0.2/classes/admin.class.php (added)
-
tags/1.0.2/classes/create_links.class.php (added)
-
tags/1.0.2/classes/main.class.php (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/template (added)
-
tags/1.0.2/template/index.txt (added)
-
tags/1.0.2/views (added)
-
tags/1.0.2/views/view_index.php (added)
-
tags/1.0.2/wp2html.php (added)
-
trunk/assets/admin.css (modified) (1 diff)
-
trunk/classes/admin.class.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/view_index.php (modified) (2 diffs)
-
trunk/wp2html.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp2html/trunk/assets/admin.css
r2546013 r2547511 14 14 background-color: #e0e0e0; 15 15 } 16 17 .wp2html-settings-section .information{ 18 border: 1px solid #ccc; 19 box-shadow: 10px 10px 0 #ccc; 20 width: calc(100% - 12px); 21 margin: 20px 0; 22 } 23 16 24 .wp2html-settings-section .row .label{ 17 25 padding: 0 10px; 18 26 font-weight: bold; 19 width: 180px;27 width: 230px; 20 28 } 21 29 22 30 .wp2html-settings-section .row .item{ 23 width: 5 70px;31 width: 520px; 24 32 padding: 0 10px; 25 33 } -
wp2html/trunk/classes/admin.class.php
r2546837 r2547511 26 26 27 27 public function index() { 28 $base_path = apply_filters( 'wp2html_change_base_path', WP2HTML_DOCUMENT_ROOT ); 28 29 $connect_server = apply_filters( 'wp2html_connect_server', WP2HTML_CONNECT_SERVER ); 29 30 $ignore_pages = $this->text2array( $this->options['ignore_pages'] ?? '' ); … … 51 52 public function run() { 52 53 $generated_paths = $this->genarate_all_paths(); 53 54 $path = rtrim( WP2HTML_DOCUMENT_ROOT. $this->options['path'], '/' );54 $base_path = apply_filters( 'wp2html_change_base_path', WP2HTML_DOCUMENT_ROOT ); 55 $path = rtrim( $base_path . $this->options['path'], '/' ); 55 56 $home = get_option( 'home' ); 56 57 … … 72 73 $generated_paths = $this->genarate_all_paths(); 73 74 74 $path = rtrim( WP2HTML_DOCUMENT_ROOT . $this->options['path'], '/' ); 75 $base_path = apply_filters( 'wp2html_change_base_path', WP2HTML_DOCUMENT_ROOT ); 76 $path = rtrim( $base_path . $this->options['path'], '/' ); 75 77 $home = get_option( 'home' ); 76 78 … … 105 107 */ 106 108 private function get_static_html_from_url( $url, $file_path ) { 107 $scheme = parse_url( $url, PHP_URL_SCHEME );108 109 $host = parse_url( $url, PHP_URL_HOST ); 109 110 … … 135 136 // strip spaces at start of the line. 136 137 $html = preg_replace( '/' . PHP_EOL . '\s+/', PHP_EOL, $html ); 138 139 if ( isset( $this->options['absolute_path'] ) ) { 140 $home = get_option( 'home' ); 141 // homeだけのURLは/に置き換え 142 $html = str_replace( '"' . $home . '"', '/', $html ); 143 $html = str_replace( $home, '', $html ); 144 } 137 145 138 146 $html = apply_filters( 'wp2html_get_static_html_from_url', $html, $url ); -
wp2html/trunk/readme.txt
r2547314 r2547511 5 5 Requires at least: 5.4 6 6 Tested up to: 5.7 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 62 62 == Changelog == 63 63 64 = 1.0.2 = 65 * Add “Convert URL to absolute path” option. 66 64 67 = 1.0.1 = 65 68 * Bug fix. -
wp2html/trunk/views/view_index.php
r2546013 r2547511 3 3 <div class="wp2html-settings-section"> 4 4 5 <div class="row"> 6 <div class="label"><?php _e( 'Base URL', WP2HTML_PLUGIN_NAME ) ?></div> 7 <div class="item"><?php echo esc_html( get_option( 'home' ) ) ?></div> 5 <div class="information"> 6 <div class="row"> 7 <div class="label"><?php _e( 'Base URL', WP2HTML_PLUGIN_NAME ) ?></div> 8 <div class="item"><?php echo esc_html( get_option( 'home' ) ) ?></div> 9 </div> 10 11 <div class="row"> 12 <div class="label"><?php _e( 'IP address to be accessed', WP2HTML_PLUGIN_NAME ) ?></div> 13 <div class="item"><?php echo esc_html( $connect_server ) ?></div> 14 </div> 8 15 </div> 9 10 11 <div class="row">12 <div class="label"><?php _e( 'IP address to be accessed', WP2HTML_PLUGIN_NAME ) ?></div>13 <div class="item"><?php echo esc_html( $connect_server ) ?></div>14 </div>15 16 <hr>17 16 18 17 <form action="<?php $this->make_admin_url( 'save' ) ?>" method="post"> … … 20 19 <div class="label"><?php _e( 'The path to write the HTML', WP2HTML_PLUGIN_NAME ) ?></div> 21 20 <div class="item"> 22 <?php echo esc_html( WP2HTML_DOCUMENT_ROOT) ?><input type="text" name="path" value="<?php $this->option_value( 'path', '/' ) ?>">21 <?php echo esc_html( $base_path ) ?><input type="text" name="path" value="<?php $this->option_value( 'path', '/' ) ?>"> 23 22 <div class="error-message"><?php echo esc_html( $this->error_message['path'] ?? '' ) ?></div> 23 </div> 24 </div> 25 26 <div class="row"> 27 <div class="label"><label for="absolute_path"><?php _e( 'Convert URL to absolute path', WP2HTML_PLUGIN_NAME ) ?></label></div> 28 <div class="item"> 29 <input type="checkbox" value="1" id="absolute_path" name="absolute_path"<?php $this->option_checked( 'absolute_path' ) ?>> 24 30 </div> 25 31 </div> -
wp2html/trunk/wp2html.php
r2546854 r2547511 4 4 Description: Make static HTMLs from WordPress 5 5 Author: Digital Acorn 6 Version: 1.0. 16 Version: 1.0.2 7 7 */ 8 8 … … 12 12 } 13 13 14 define( 'WP2HTML_VERSION', '1.0. 1' );14 define( 'WP2HTML_VERSION', '1.0.2' ); 15 15 define( 'WP2HTML_MENU_SLUG', 'wordpress2html' ); 16 16 define( 'WP2HTML_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.