Plugin Directory

Changeset 2316307


Ignore:
Timestamp:
06/02/2020 04:06:59 AM (6 years ago)
Author:
kanakogi
Message:

2.0.0

Location:
auto-load-page-template
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • auto-load-page-template/tags/2.0.0/auto-load-page-template.php

    r1873747 r2316307  
    55Description: 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.
    66Author: Nakashima Masahiro
    7 Version: 1.2.0
     7Version: 2.0.0
    88Author URI: http://www.kigurumi.asia
    99License: GPLv2 or later
     
    1111Domain Path: /languages/
    1212 */
    13 define('ALPT_VERSION', '1.2.0');
     13define('ALPT_VERSION', '2.0.0');
    1414define('ALPT_PLUGIN_BASENAME', plugin_basename(__FILE__));
    1515define('ALPT_PLUGIN_NAME', trim(dirname(ALPT_PLUGIN_BASENAME), '/'));
     
    3131        //固定ページの読み込むテンプレートを変更
    3232        add_filter('page_template', array($this, 'get_page_template'));
     33        add_filter('home_template', array($this, 'get_page_template'));
    3334        // プラグインが有効・無効化されたとき
    3435        register_activation_hook(__FILE__, array($this, 'activation_hook'));
     
    5253
    5354            //子テーマ
     55            $child_template_static_path = get_stylesheet_directory() . '/static/' . $template_path . 'index.php';
    5456            $child_template_path = get_stylesheet_directory() . $template_path . 'index.php';
    55             $child_template_path2 = get_stylesheet_directory() . $template_path . '/index.php';
    5657            //親テーマ
     58            $parent_template_static_path = get_template_directory() . '/static/' . $template_path . 'index.php';
    5759            $parent_template_path = get_template_directory() . $template_path . 'index.php';
    58             $parent_template_path2 = get_template_directory() . $template_path . '/index.php';
    5960
    6061            //テンプレートファイルがあるかどうかを子テーマを優先して調べる
    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)) {
    6265                $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;
    6568            } elseif (file_exists($parent_template_path)) {
    6669                $template = $parent_template_path;
    67             } elseif (file_exists($parent_template_path2)) {
    68                 $template = $parent_template_path2;
    6970            }
    7071        }
     
    7980        // 保存できるかどうかをチェックする
    8081        $options = get_option(ALPT_PLUGIN_NAME);
    81         if( !$options['can_push_post'] ){
     82        if (!$options['can_push_post']) {
    8283            return;
    8384        }
  • auto-load-page-template/tags/2.0.0/classes/class.admin.php

    r1345664 r2316307  
    112112                            <td>
    113113                                <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>
    114117                            </td>
    115118                        </tr>
  • auto-load-page-template/tags/2.0.0/readme.txt

    r1873748 r2316307  
    44Tags: : page, pages,theme, themes
    55Requires at least: 3.0 or higher
    6 Tested up to: 4.9.5
    7 Stable tag: 1.2.0
     6Tested up to: 5.4.1
     7Stable tag: 2.0.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • auto-load-page-template/trunk/auto-load-page-template.php

    r1873747 r2316307  
    55Description: 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.
    66Author: Nakashima Masahiro
    7 Version: 1.2.0
     7Version: 2.0.0
    88Author URI: http://www.kigurumi.asia
    99License: GPLv2 or later
     
    1111Domain Path: /languages/
    1212 */
    13 define('ALPT_VERSION', '1.2.0');
     13define('ALPT_VERSION', '2.0.0');
    1414define('ALPT_PLUGIN_BASENAME', plugin_basename(__FILE__));
    1515define('ALPT_PLUGIN_NAME', trim(dirname(ALPT_PLUGIN_BASENAME), '/'));
     
    3131        //固定ページの読み込むテンプレートを変更
    3232        add_filter('page_template', array($this, 'get_page_template'));
     33        add_filter('home_template', array($this, 'get_page_template'));
    3334        // プラグインが有効・無効化されたとき
    3435        register_activation_hook(__FILE__, array($this, 'activation_hook'));
     
    5253
    5354            //子テーマ
     55            $child_template_static_path = get_stylesheet_directory() . '/static/' . $template_path . 'index.php';
    5456            $child_template_path = get_stylesheet_directory() . $template_path . 'index.php';
    55             $child_template_path2 = get_stylesheet_directory() . $template_path . '/index.php';
    5657            //親テーマ
     58            $parent_template_static_path = get_template_directory() . '/static/' . $template_path . 'index.php';
    5759            $parent_template_path = get_template_directory() . $template_path . 'index.php';
    58             $parent_template_path2 = get_template_directory() . $template_path . '/index.php';
    5960
    6061            //テンプレートファイルがあるかどうかを子テーマを優先して調べる
    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)) {
    6265                $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;
    6568            } elseif (file_exists($parent_template_path)) {
    6669                $template = $parent_template_path;
    67             } elseif (file_exists($parent_template_path2)) {
    68                 $template = $parent_template_path2;
    6970            }
    7071        }
     
    7980        // 保存できるかどうかをチェックする
    8081        $options = get_option(ALPT_PLUGIN_NAME);
    81         if( !$options['can_push_post'] ){
     82        if (!$options['can_push_post']) {
    8283            return;
    8384        }
  • auto-load-page-template/trunk/classes/class.admin.php

    r1345664 r2316307  
    112112                            <td>
    113113                                <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>
    114117                            </td>
    115118                        </tr>
  • auto-load-page-template/trunk/readme.txt

    r1873748 r2316307  
    44Tags: : page, pages,theme, themes
    55Requires at least: 3.0 or higher
    6 Tested up to: 4.9.5
    7 Stable tag: 1.2.0
     6Tested up to: 5.4.1
     7Stable tag: 2.0.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.