Changeset 2316307
- Timestamp:
- 06/02/2020 04:06:59 AM (6 years ago)
- Location:
- auto-load-page-template
- Files:
-
- 6 edited
- 1 copied
-
tags/2.0.0 (copied) (copied from auto-load-page-template/trunk)
-
tags/2.0.0/auto-load-page-template.php (modified) (5 diffs)
-
tags/2.0.0/classes/class.admin.php (modified) (1 diff)
-
tags/2.0.0/readme.txt (modified) (1 diff)
-
trunk/auto-load-page-template.php (modified) (5 diffs)
-
trunk/classes/class.admin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
auto-load-page-template/tags/2.0.0/auto-load-page-template.php
r1873747 r2316307 5 5 Description: If this plug-in is enabled, and there is a file on the same theme level as the static page URL level, then that theme file will automatically be loaded as the template file. 6 6 Author: Nakashima Masahiro 7 Version: 1.2.07 Version: 2.0.0 8 8 Author URI: http://www.kigurumi.asia 9 9 License: GPLv2 or later … … 11 11 Domain Path: /languages/ 12 12 */ 13 define('ALPT_VERSION', ' 1.2.0');13 define('ALPT_VERSION', '2.0.0'); 14 14 define('ALPT_PLUGIN_BASENAME', plugin_basename(__FILE__)); 15 15 define('ALPT_PLUGIN_NAME', trim(dirname(ALPT_PLUGIN_BASENAME), '/')); … … 31 31 //固定ページの読み込むテンプレートを変更 32 32 add_filter('page_template', array($this, 'get_page_template')); 33 add_filter('home_template', array($this, 'get_page_template')); 33 34 // プラグインが有効・無効化されたとき 34 35 register_activation_hook(__FILE__, array($this, 'activation_hook')); … … 52 53 53 54 //子テーマ 55 $child_template_static_path = get_stylesheet_directory() . '/static/' . $template_path . 'index.php'; 54 56 $child_template_path = get_stylesheet_directory() . $template_path . 'index.php'; 55 $child_template_path2 = get_stylesheet_directory() . $template_path . '/index.php';56 57 //親テーマ 58 $parent_template_static_path = get_template_directory() . '/static/' . $template_path . 'index.php'; 57 59 $parent_template_path = get_template_directory() . $template_path . 'index.php'; 58 $parent_template_path2 = get_template_directory() . $template_path . '/index.php';59 60 60 61 //テンプレートファイルがあるかどうかを子テーマを優先して調べる 61 if (file_exists($child_template_path)) { 62 if (file_exists($child_template_static_path)) { 63 $template = $child_template_static_path; 64 } elseif (file_exists($child_template_path)) { 62 65 $template = $child_template_path; 63 } elseif (file_exists($parent_template_ path2)) {64 $template = $ child_template_path2;66 } elseif (file_exists($parent_template_static_path)) { 67 $template = $parent_template_static_path; 65 68 } elseif (file_exists($parent_template_path)) { 66 69 $template = $parent_template_path; 67 } elseif (file_exists($parent_template_path2)) {68 $template = $parent_template_path2;69 70 } 70 71 } … … 79 80 // 保存できるかどうかをチェックする 80 81 $options = get_option(ALPT_PLUGIN_NAME); 81 if ( !$options['can_push_post'] ){82 if (!$options['can_push_post']) { 82 83 return; 83 84 } -
auto-load-page-template/tags/2.0.0/classes/class.admin.php
r1345664 r2316307 112 112 <td> 113 113 <input type="checkbox" name="can_push_post" value="1" <?php if( $options['can_push_post'] ): ?>checked="checked"<?php endif; ?> > 114 <p> 115 ex) $auto_load_page_template->push_post('.selector'); 116 </p> 114 117 </td> 115 118 </tr> -
auto-load-page-template/tags/2.0.0/readme.txt
r1873748 r2316307 4 4 Tags: : page, pages,theme, themes 5 5 Requires at least: 3.0 or higher 6 Tested up to: 4.9.57 Stable tag: 1.2.06 Tested up to: 5.4.1 7 Stable tag: 2.0.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
auto-load-page-template/trunk/auto-load-page-template.php
r1873747 r2316307 5 5 Description: If this plug-in is enabled, and there is a file on the same theme level as the static page URL level, then that theme file will automatically be loaded as the template file. 6 6 Author: Nakashima Masahiro 7 Version: 1.2.07 Version: 2.0.0 8 8 Author URI: http://www.kigurumi.asia 9 9 License: GPLv2 or later … … 11 11 Domain Path: /languages/ 12 12 */ 13 define('ALPT_VERSION', ' 1.2.0');13 define('ALPT_VERSION', '2.0.0'); 14 14 define('ALPT_PLUGIN_BASENAME', plugin_basename(__FILE__)); 15 15 define('ALPT_PLUGIN_NAME', trim(dirname(ALPT_PLUGIN_BASENAME), '/')); … … 31 31 //固定ページの読み込むテンプレートを変更 32 32 add_filter('page_template', array($this, 'get_page_template')); 33 add_filter('home_template', array($this, 'get_page_template')); 33 34 // プラグインが有効・無効化されたとき 34 35 register_activation_hook(__FILE__, array($this, 'activation_hook')); … … 52 53 53 54 //子テーマ 55 $child_template_static_path = get_stylesheet_directory() . '/static/' . $template_path . 'index.php'; 54 56 $child_template_path = get_stylesheet_directory() . $template_path . 'index.php'; 55 $child_template_path2 = get_stylesheet_directory() . $template_path . '/index.php';56 57 //親テーマ 58 $parent_template_static_path = get_template_directory() . '/static/' . $template_path . 'index.php'; 57 59 $parent_template_path = get_template_directory() . $template_path . 'index.php'; 58 $parent_template_path2 = get_template_directory() . $template_path . '/index.php';59 60 60 61 //テンプレートファイルがあるかどうかを子テーマを優先して調べる 61 if (file_exists($child_template_path)) { 62 if (file_exists($child_template_static_path)) { 63 $template = $child_template_static_path; 64 } elseif (file_exists($child_template_path)) { 62 65 $template = $child_template_path; 63 } elseif (file_exists($parent_template_ path2)) {64 $template = $ child_template_path2;66 } elseif (file_exists($parent_template_static_path)) { 67 $template = $parent_template_static_path; 65 68 } elseif (file_exists($parent_template_path)) { 66 69 $template = $parent_template_path; 67 } elseif (file_exists($parent_template_path2)) {68 $template = $parent_template_path2;69 70 } 70 71 } … … 79 80 // 保存できるかどうかをチェックする 80 81 $options = get_option(ALPT_PLUGIN_NAME); 81 if ( !$options['can_push_post'] ){82 if (!$options['can_push_post']) { 82 83 return; 83 84 } -
auto-load-page-template/trunk/classes/class.admin.php
r1345664 r2316307 112 112 <td> 113 113 <input type="checkbox" name="can_push_post" value="1" <?php if( $options['can_push_post'] ): ?>checked="checked"<?php endif; ?> > 114 <p> 115 ex) $auto_load_page_template->push_post('.selector'); 116 </p> 114 117 </td> 115 118 </tr> -
auto-load-page-template/trunk/readme.txt
r1873748 r2316307 4 4 Tags: : page, pages,theme, themes 5 5 Requires at least: 3.0 or higher 6 Tested up to: 4.9.57 Stable tag: 1.2.06 Tested up to: 5.4.1 7 Stable tag: 2.0.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.