Plugin Directory

Changeset 3759320


Ignore:
Timestamp:
10/22/2026 04:55:55 AM (4 weeks ago)
Author:
eclouds
Message:

Release 2.0.1

プラグイン付属の CSS を、管理画面でオフにしているときは出さないようにした。
旧バージョンから入れ替えたときに出ていた警告を止めた。
「すべて」が英語のまま残るのを直した。
検索条件が結果に反映されるよう、検索の受け渡しを直した。
WordPress 7.1.3 で動作することを確認した。

Location:
detabess
Files:
7 edited
28 copied

Legend:

Unmodified
Added
Removed
  • detabess/tags/2.0.1/detabess-core.php

    r3753085 r3759320  
    5151                        return;
    5252                }
    53                 if ( ! $query instanceof WP_Query || ! $query->is_main_query() || ! $query->is_search() ) {
     53                if ( ! $query instanceof WP_Query || ! $query->is_main_query() ) {
     54                        return;
     55                }
     56
     57                $cdb = $this->request_cdb( $query );
     58                if ( $cdb <= 0 ) {
    5459                        return;
    5560                }
    … …  
    6772
    6873                $param = $this->post_param_array();
    69 
    70                 // 通常の検索の場合
    71                 if ( ! isset( $_GET['cdb'] ) || ! is_numeric( $_GET['cdb'] ) ) {
    72                         return;
    73                 }
    74 
    75                 $cdb = 0;
    76 
    77                 if ( isset( $_GET['cdb'] ) ) {
    78                         $cdb = sanitize_key( $_GET['cdb'] );
    79 
    80                         if ( ! is_numeric( $cdb ) ) {
    81                                 return;
    82                         }
    83                 } else {
    84                         return;
    85                 }
    86 
    87                 // 検索ページではない場合
    88                 if ( ! $query->is_search() ) {
    89                         return;
    90                 }
    91 
    92                 // 管理画面,メインクエリに干渉しないために必須
    93                 if ( is_admin() || ! $query->is_main_query() ) {
    94                         return;
    95                 }
    96 
    97                 $target_postID = ( is_array( $param ) && count( $param ) > 0 ) ? $this->target_list( $cdb, $param , $lang ) : dtbs_all_postid_list( $cdb , $lang );
     74                if ( ! is_array( $param ) ) {
     75                        $param = array();
     76                }
     77
     78                // s に検索条件そのものを入れると、WordPress のキーワード検索で件数が 0 になる
     79                $query->set( 's', '' );
     80
     81                $target_postID = ( count( $param ) > 0 ) ? $this->target_list( $cdb, $param , $lang ) : dtbs_all_postid_list( $cdb , $lang );
    9882
    9983                if ( count( $target_postID ) > 0 ) {
    … …  
    11296
    11397        /**
    114          * 入力されてきたパラメータの分解
    115          *
    116          * @param string $source URLパラメータを指定
    117          * @return array
    118          */
     98         * リクエストからデタベス ID を取り出す
     99         *
     100         * @param WP_Query|null $query メインクエリ
     101         * @return int
     102         */
     103        public function request_cdb( $query = null ) {
     104                if ( isset( $_GET['cdb'] ) && is_numeric( $_GET['cdb'] ) ) {
     105                        return absint( $_GET['cdb'] );
     106                }
     107                if ( $query instanceof WP_Query && is_numeric( $query->get( 'cdb' ) ) ) {
     108                        return absint( $query->get( 'cdb' ) );
     109                }
     110                if ( function_exists( 'get_query_var' ) ) {
     111                        $query_cdb = get_query_var( 'cdb' );
     112                        if ( is_numeric( $query_cdb ) && $query_cdb > 0 ) {
     113                                return absint( $query_cdb );
     114                        }
     115                }
     116                return 0;
     117        }
     118
     119        /**
     120         * ci1_3 や ci6_28_29 を項目 ID => 値 に分解する
     121         *
     122         * @param array  $res_param 既存の条件
     123         * @param string $text URL またはクエリ文字列
     124         */
     125        protected function append_directory_params( &$res_param, $text ) {
     126                if ( ! is_string( $text ) || '' === $text ) {
     127                        return;
     128                }
     129                if ( ! preg_match_all( '/(?:^|[,\/&?])ci([0-9]+)_([0-9]+(?:_[0-9]+)*)/', $text, $matches, PREG_SET_ORDER ) ) {
     130                        return;
     131                }
     132                foreach ( $matches as $val ) {
     133                        $id = (string) absint( $val[1] );
     134                        if ( isset( $res_param[ $id ] ) && '' !== (string) $res_param[ $id ] ) {
     135                                continue;
     136                        }
     137                        $res_param[ $id ] = str_replace( '_', ',', $val[2] );
     138                }
     139        }
     140
    119141        public function post_param_array( $source = '' ) {
    120                 if ( empty( $_GET['cdb'] ) && empty( $source ) ) {
     142                if ( empty( $_GET['cdb'] ) && empty( $source ) && $this->request_cdb() <= 0 ) {
    121143                        return;
    122144                }
    … …  
    124146                $res_param = array();
    125147
    126                 $key = ! empty( $source ) ? $source : $_SERVER['QUERY_STRING'];
     148                $key = ! empty( $source ) ? $source : ( isset( $_SERVER['QUERY_STRING'] ) ? $_SERVER['QUERY_STRING'] : '' );
    127149
    128150                preg_match_all( '/ci([0-9]{1,})=([,0-9]{1,})?/us', $key, $param, PREG_SET_ORDER );
    … …  
    140162                                }
    141163                        }
     164                }
     165
     166                $this->append_directory_params( $res_param, $key );
     167                if ( empty( $source ) && isset( $_SERVER['REQUEST_URI'] ) ) {
     168                        $this->append_directory_params( $res_param, wp_unslash( $_SERVER['REQUEST_URI'] ) );
    142169                }
    143170
    … …  
    526553                                                $list          .= '<span' . $class_id_param . ">\n";
    527554                                                if ( ! isset( $child_tree_list[ $cdi_id ] ) ) {
    528                                                         $list .= '<label><input type="radio" name="ci' . esc_attr( $cdi_id ) . '" value="0"  checked="checked"><span><i></i>' . esc_html( __( 'For all' , DTBS_SCNAME ) ) . '</span></label>' . "\n";
     555                                                        $list .= '<label><input type="radio" name="ci' . esc_attr( $cdi_id ) . '" value="0"  checked="checked"><span><i></i>' . esc_html( __( 'all', DTBS_SCNAME ) ) . '</span></label>' . "\n";
    529556                                                }
    530557                                                foreach ( $val['list'] as $cdd_id => $cdd_val ) {
  • detabess/tags/2.0.1/detabess-info.php

    r3753085 r3759320  
    5454                                                        <img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/info/common/logo.svg" alt="<?php _e( DTBS_SCNAME ); ?>" width="477" height="82" alt="">
    5555                                                </span>
    56                                                 <span class="version">v2.0</span>
     56                                                <span class="version">v2.0.1</span>
    5757                                        </h2>
    5858                                </div>
  • detabess/tags/2.0.1/detabess-reg.php

    r3753085 r3759320  
    303303        $admin_style = dtbs_get_admin_item_style();
    304304
    305         $view_default_css = dtbs_view_default_css( $_GET['cd_id'] );
     305        $view_default_css = dtbs_view_default_css( isset( $_GET['cd_id'] ) ? absint( $_GET['cd_id'] ) : 0 );
    306306
    307307        if ( isset( $added_item_list ) ) {
    … …  
    589589
    590590                if ( isset( $_GET['cd_id'] ) && function_exists( 'dtbsp_acf' ) ) {
    591                         $dtbsp_acf_style = array();
    592                         $dtbsp_acf_style = get_option( 'dtbsp_acf_style' );
    593                         if ( ! empty( $dtbsp_acf_style ) ) {
     591                        $dtbsp_acf_style = get_option( 'dtbsp_acf_style', '' );
     592                        if ( is_string( $dtbsp_acf_style ) ) {
     593                                $dtbsp_acf_style = maybe_unserialize( $dtbsp_acf_style );
     594                        }
     595                        if ( is_array( $dtbsp_acf_style ) ) {
    594596                                foreach( $dtbsp_acf_style as $acf_id => $acf_vals ) {
     597                                        if ( ! is_array( $acf_vals ) || ! isset( $acf_vals['cd_id'] ) ) {
     598                                                continue;
     599                                        }
    595600                                        if ( $_GET['cd_id'] == $acf_vals['cd_id'] ) {
    596601                                                $reg_param['acf'] = $acf_vals['style'];
  • detabess/tags/2.0.1/detabess-table.php

    r3753085 r3759320  
    187187        }
    188188        if ( 'n' == $active ) {
    189                 $sql = 'ALTER TABLE `' . $wpdb->prefix . "dtbs` ADD `cd_default_css` enum('y','n') NOT NULL DEFAULT 'y' AFTER `cd_search_word`";
     189                $default = ( 'y' === get_option( 'dtbs_css_active', 'n' ) ) ? 'y' : 'n';
     190                $sql = 'ALTER TABLE `' . $wpdb->prefix . "dtbs` ADD `cd_default_css` enum('y','n') NOT NULL DEFAULT '" . $default . "' AFTER `cd_search_word`";
    190191                $wpdb->query( $sql );
    191192        }
  • detabess/tags/2.0.1/detabess.php

    r3753085 r3759320  
    55 * Plugin URI: https://detabess.com/
    66 * Author: Kura
    7  * Version: 2.0
     7 * Version: 2.0.1
    88 * Text Domain: detabess
    99 * Domain Path: /languages
    … …  
    7373                $enqueue_form_assets = false;
    7474                foreach ( $dtbs_list as $dtbs_val ) {
    75                         if ( ! isset( $dtbs_val['cd_default_css'] ) || 'y' === $dtbs_val['cd_default_css'] ) {
     75                        if ( isset( $dtbs_val['cd_default_css'] ) && 'y' === $dtbs_val['cd_default_css'] ) {
    7676                                $enqueue_form_assets = true;
    7777                                break;
    … …  
    179179        }
    180180        require_once plugin_dir_path( __FILE__ ) . 'detabess-table.php';
     181        global $wpdb;
    181182        if ( '2' !== get_option( 'dtbs_match_has_cdd_id_index' ) ) {
    182183                update_dtbs_detail_match_indexes();
    183184                update_option( 'dtbs_match_has_cdd_id_index', '2', false );
     185        }
     186        if ( ! get_option( 'dtbs_has_default_css_column' ) ) {
     187                update_dtbs_table();
     188                $css_column = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $wpdb->prefix . "dtbs WHERE Field='cd_default_css'" );
     189                if ( ! empty( $css_column ) ) {
     190                        update_option( 'dtbs_has_default_css_column', '1', false );
     191                }
    184192        }
    185193        if ( get_option( 'dtbs_item_has_admin_style' ) ) {
    … …  
    236244add_action( 'dtbs_loaded', 'dtbs_create_submenus', 30 );
    237245
     246
     247add_filter( 'query_vars', function( $vars ) {
     248        $vars[] = 'cdb';
     249        return $vars;
     250} );
    238251
    239252add_action( 'wp_enqueue_scripts', 'dtbs_files' );
  • detabess/tags/2.0.1/js/detabess.js

    r3753085 r3759320  
    426426                        });
    427427                }
    428                 const   uri_param = 'scd=' + dtbs_common.class_info.scd + now_param;
     428                var joined = now_param;
     429                if ( joined && joined.charAt( 0 ) !== '&' && joined.charAt( 0 ) !== ',' ) {
     430                        joined = '&' + joined;
     431                }
     432                const   uri_param = 'scd=' + dtbs_common.class_info.scd + joined;
     433
     434                var count_path = '';
     435                if ( $( '#from_url' ).length ) {
     436                        count_path = $( '#from_url' ).val();
     437                }
    429438
    430439                $.ajax(
    … …  
    436445                                        'scdb' : uri_param,
    437446                                        'params' : other_param,
     447                                        'path' : count_path,
    438448                                        'lang' : def_params.lang
    439449                                },
    … …  
    563573
    564574                        if ( form_class.match( /^([-_0-9a-z]+)$/ ) && 'dtbs_forms' !== form_class ) {
    565                                 location.href = ( '' === param ) ? def_params.site_url + '/' + form_class + '/' : def_params.site_url + '/' + form_class + '/' + param + '/';
     575                                var search_path = ( '' === param ) ? def_params.site_url + '/' + form_class + '/' : def_params.site_url + '/' + form_class + '/' + param + '/';
     576                                if ( '' !== with_param ) {
     577                                        search_path += '?' + with_param;
     578                                }
     579                                location.href = search_path;
    566580                        } else {
    567                                 location.href = def_params.site_url + '/?s=' + param + '&cdb=' + submit_id[1];
     581                                var search_path = def_params.site_url + '/?s=dtbs&cdb=' + submit_id[1];
     582                                if ( '' !== param ) {
     583                                        search_path += '&' + param;
     584                                }
     585                                if ( '' !== with_param ) {
     586                                        search_path += '&' + with_param;
     587                                }
     588                                location.href = search_path;
    568589                        }
    569590
  • detabess/tags/2.0.1/readme.txt

    r3753085 r3759320  
    33Tags: database, search, data, relation, list, データベース, 検索
    44Requires at least: 4.7.0
    5 Tested up to: 6.8
    6 Stable tag: 2.0
     5Tested up to: 7.1
     6Stable tag: 2.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    117117== Upgrade Notice ==
    118118
     119= 2.0.1 =
     120プラグイン付属の CSS を、管理画面でオフにしているときは出さないようにした。旧バージョンから入れ替えたときに出ていた警告を止めた。「すべて」が英語のまま残るのを直した。検索条件が結果に反映されるよう、検索の受け渡しを直した。WordPress 7.1.3 で動作することを確認した。
     121
    119122= 2.0 =
    120123オブジェクト形式への整理、管理画面の権限確認、検索件数の高速化、編集画面が白くなる問題の修正を行いました。
    … …  
    141144== Changelog ==
    142145
     146= 2.0.1 =
     147* プラグイン付属の CSS を、管理画面でオフにしているときは出さないようにした
     148* 旧バージョンから入れ替えたときに出ていた警告を止めた
     149* 「すべて」が英語のまま残るのを直した
     150* 検索条件が結果に反映されるよう、検索の受け渡しを直した
     151* WordPress 7.1.3 で動作することを確認した
     152
    143153= 2.0 =
    144154オブジェクト形式への整理、管理画面の権限確認、検索件数の高速化、編集画面が白くなる問題の修正を行いました。
  • detabess/trunk/detabess-core.php

    r3753085 r3759320  
    5151                        return;
    5252                }
    53                 if ( ! $query instanceof WP_Query || ! $query->is_main_query() || ! $query->is_search() ) {
     53                if ( ! $query instanceof WP_Query || ! $query->is_main_query() ) {
     54                        return;
     55                }
     56
     57                $cdb = $this->request_cdb( $query );
     58                if ( $cdb <= 0 ) {
    5459                        return;
    5560                }
    … …  
    6772
    6873                $param = $this->post_param_array();
    69 
    70                 // 通常の検索の場合
    71                 if ( ! isset( $_GET['cdb'] ) || ! is_numeric( $_GET['cdb'] ) ) {
    72                         return;
    73                 }
    74 
    75                 $cdb = 0;
    76 
    77                 if ( isset( $_GET['cdb'] ) ) {
    78                         $cdb = sanitize_key( $_GET['cdb'] );
    79 
    80                         if ( ! is_numeric( $cdb ) ) {
    81                                 return;
    82                         }
    83                 } else {
    84                         return;
    85                 }
    86 
    87                 // 検索ページではない場合
    88                 if ( ! $query->is_search() ) {
    89                         return;
    90                 }
    91 
    92                 // 管理画面,メインクエリに干渉しないために必須
    93                 if ( is_admin() || ! $query->is_main_query() ) {
    94                         return;
    95                 }
    96 
    97                 $target_postID = ( is_array( $param ) && count( $param ) > 0 ) ? $this->target_list( $cdb, $param , $lang ) : dtbs_all_postid_list( $cdb , $lang );
     74                if ( ! is_array( $param ) ) {
     75                        $param = array();
     76                }
     77
     78                // s に検索条件そのものを入れると、WordPress のキーワード検索で件数が 0 になる
     79                $query->set( 's', '' );
     80
     81                $target_postID = ( count( $param ) > 0 ) ? $this->target_list( $cdb, $param , $lang ) : dtbs_all_postid_list( $cdb , $lang );
    9882
    9983                if ( count( $target_postID ) > 0 ) {
    … …  
    11296
    11397        /**
    114          * 入力されてきたパラメータの分解
    115          *
    116          * @param string $source URLパラメータを指定
    117          * @return array
    118          */
     98         * リクエストからデタベス ID を取り出す
     99         *
     100         * @param WP_Query|null $query メインクエリ
     101         * @return int
     102         */
     103        public function request_cdb( $query = null ) {
     104                if ( isset( $_GET['cdb'] ) && is_numeric( $_GET['cdb'] ) ) {
     105                        return absint( $_GET['cdb'] );
     106                }
     107                if ( $query instanceof WP_Query && is_numeric( $query->get( 'cdb' ) ) ) {
     108                        return absint( $query->get( 'cdb' ) );
     109                }
     110                if ( function_exists( 'get_query_var' ) ) {
     111                        $query_cdb = get_query_var( 'cdb' );
     112                        if ( is_numeric( $query_cdb ) && $query_cdb > 0 ) {
     113                                return absint( $query_cdb );
     114                        }
     115                }
     116                return 0;
     117        }
     118
     119        /**
     120         * ci1_3 や ci6_28_29 を項目 ID => 値 に分解する
     121         *
     122         * @param array  $res_param 既存の条件
     123         * @param string $text URL またはクエリ文字列
     124         */
     125        protected function append_directory_params( &$res_param, $text ) {
     126                if ( ! is_string( $text ) || '' === $text ) {
     127                        return;
     128                }
     129                if ( ! preg_match_all( '/(?:^|[,\/&?])ci([0-9]+)_([0-9]+(?:_[0-9]+)*)/', $text, $matches, PREG_SET_ORDER ) ) {
     130                        return;
     131                }
     132                foreach ( $matches as $val ) {
     133                        $id = (string) absint( $val[1] );
     134                        if ( isset( $res_param[ $id ] ) && '' !== (string) $res_param[ $id ] ) {
     135                                continue;
     136                        }
     137                        $res_param[ $id ] = str_replace( '_', ',', $val[2] );
     138                }
     139        }
     140
    119141        public function post_param_array( $source = '' ) {
    120                 if ( empty( $_GET['cdb'] ) && empty( $source ) ) {
     142                if ( empty( $_GET['cdb'] ) && empty( $source ) && $this->request_cdb() <= 0 ) {
    121143                        return;
    122144                }
    … …  
    124146                $res_param = array();
    125147
    126                 $key = ! empty( $source ) ? $source : $_SERVER['QUERY_STRING'];
     148                $key = ! empty( $source ) ? $source : ( isset( $_SERVER['QUERY_STRING'] ) ? $_SERVER['QUERY_STRING'] : '' );
    127149
    128150                preg_match_all( '/ci([0-9]{1,})=([,0-9]{1,})?/us', $key, $param, PREG_SET_ORDER );
    … …  
    140162                                }
    141163                        }
     164                }
     165
     166                $this->append_directory_params( $res_param, $key );
     167                if ( empty( $source ) && isset( $_SERVER['REQUEST_URI'] ) ) {
     168                        $this->append_directory_params( $res_param, wp_unslash( $_SERVER['REQUEST_URI'] ) );
    142169                }
    143170
    … …  
    526553                                                $list          .= '<span' . $class_id_param . ">\n";
    527554                                                if ( ! isset( $child_tree_list[ $cdi_id ] ) ) {
    528                                                         $list .= '<label><input type="radio" name="ci' . esc_attr( $cdi_id ) . '" value="0"  checked="checked"><span><i></i>' . esc_html( __( 'For all' , DTBS_SCNAME ) ) . '</span></label>' . "\n";
     555                                                        $list .= '<label><input type="radio" name="ci' . esc_attr( $cdi_id ) . '" value="0"  checked="checked"><span><i></i>' . esc_html( __( 'all', DTBS_SCNAME ) ) . '</span></label>' . "\n";
    529556                                                }
    530557                                                foreach ( $val['list'] as $cdd_id => $cdd_val ) {
  • detabess/trunk/detabess-info.php

    r3753085 r3759320  
    5454                                                        <img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/info/common/logo.svg" alt="<?php _e( DTBS_SCNAME ); ?>" width="477" height="82" alt="">
    5555                                                </span>
    56                                                 <span class="version">v2.0</span>
     56                                                <span class="version">v2.0.1</span>
    5757                                        </h2>
    5858                                </div>
  • detabess/trunk/detabess-reg.php

    r3753085 r3759320  
    303303        $admin_style = dtbs_get_admin_item_style();
    304304
    305         $view_default_css = dtbs_view_default_css( $_GET['cd_id'] );
     305        $view_default_css = dtbs_view_default_css( isset( $_GET['cd_id'] ) ? absint( $_GET['cd_id'] ) : 0 );
    306306
    307307        if ( isset( $added_item_list ) ) {
    … …  
    589589
    590590                if ( isset( $_GET['cd_id'] ) && function_exists( 'dtbsp_acf' ) ) {
    591                         $dtbsp_acf_style = array();
    592                         $dtbsp_acf_style = get_option( 'dtbsp_acf_style' );
    593                         if ( ! empty( $dtbsp_acf_style ) ) {
     591                        $dtbsp_acf_style = get_option( 'dtbsp_acf_style', '' );
     592                        if ( is_string( $dtbsp_acf_style ) ) {
     593                                $dtbsp_acf_style = maybe_unserialize( $dtbsp_acf_style );
     594                        }
     595                        if ( is_array( $dtbsp_acf_style ) ) {
    594596                                foreach( $dtbsp_acf_style as $acf_id => $acf_vals ) {
     597                                        if ( ! is_array( $acf_vals ) || ! isset( $acf_vals['cd_id'] ) ) {
     598                                                continue;
     599                                        }
    595600                                        if ( $_GET['cd_id'] == $acf_vals['cd_id'] ) {
    596601                                                $reg_param['acf'] = $acf_vals['style'];
  • detabess/trunk/detabess-table.php

    r3753085 r3759320  
    187187        }
    188188        if ( 'n' == $active ) {
    189                 $sql = 'ALTER TABLE `' . $wpdb->prefix . "dtbs` ADD `cd_default_css` enum('y','n') NOT NULL DEFAULT 'y' AFTER `cd_search_word`";
     189                $default = ( 'y' === get_option( 'dtbs_css_active', 'n' ) ) ? 'y' : 'n';
     190                $sql = 'ALTER TABLE `' . $wpdb->prefix . "dtbs` ADD `cd_default_css` enum('y','n') NOT NULL DEFAULT '" . $default . "' AFTER `cd_search_word`";
    190191                $wpdb->query( $sql );
    191192        }
  • detabess/trunk/detabess.php

    r3753085 r3759320  
    55 * Plugin URI: https://detabess.com/
    66 * Author: Kura
    7  * Version: 2.0
     7 * Version: 2.0.1
    88 * Text Domain: detabess
    99 * Domain Path: /languages
    … …  
    7373                $enqueue_form_assets = false;
    7474                foreach ( $dtbs_list as $dtbs_val ) {
    75                         if ( ! isset( $dtbs_val['cd_default_css'] ) || 'y' === $dtbs_val['cd_default_css'] ) {
     75                        if ( isset( $dtbs_val['cd_default_css'] ) && 'y' === $dtbs_val['cd_default_css'] ) {
    7676                                $enqueue_form_assets = true;
    7777                                break;
    … …  
    179179        }
    180180        require_once plugin_dir_path( __FILE__ ) . 'detabess-table.php';
     181        global $wpdb;
    181182        if ( '2' !== get_option( 'dtbs_match_has_cdd_id_index' ) ) {
    182183                update_dtbs_detail_match_indexes();
    183184                update_option( 'dtbs_match_has_cdd_id_index', '2', false );
     185        }
     186        if ( ! get_option( 'dtbs_has_default_css_column' ) ) {
     187                update_dtbs_table();
     188                $css_column = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $wpdb->prefix . "dtbs WHERE Field='cd_default_css'" );
     189                if ( ! empty( $css_column ) ) {
     190                        update_option( 'dtbs_has_default_css_column', '1', false );
     191                }
    184192        }
    185193        if ( get_option( 'dtbs_item_has_admin_style' ) ) {
    … …  
    236244add_action( 'dtbs_loaded', 'dtbs_create_submenus', 30 );
    237245
     246
     247add_filter( 'query_vars', function( $vars ) {
     248        $vars[] = 'cdb';
     249        return $vars;
     250} );
    238251
    239252add_action( 'wp_enqueue_scripts', 'dtbs_files' );
  • detabess/trunk/js/detabess.js

    r3753085 r3759320  
    426426                        });
    427427                }
    428                 const   uri_param = 'scd=' + dtbs_common.class_info.scd + now_param;
     428                var joined = now_param;
     429                if ( joined && joined.charAt( 0 ) !== '&' && joined.charAt( 0 ) !== ',' ) {
     430                        joined = '&' + joined;
     431                }
     432                const   uri_param = 'scd=' + dtbs_common.class_info.scd + joined;
     433
     434                var count_path = '';
     435                if ( $( '#from_url' ).length ) {
     436                        count_path = $( '#from_url' ).val();
     437                }
    429438
    430439                $.ajax(
    … …  
    436445                                        'scdb' : uri_param,
    437446                                        'params' : other_param,
     447                                        'path' : count_path,
    438448                                        'lang' : def_params.lang
    439449                                },
    … …  
    563573
    564574                        if ( form_class.match( /^([-_0-9a-z]+)$/ ) && 'dtbs_forms' !== form_class ) {
    565                                 location.href = ( '' === param ) ? def_params.site_url + '/' + form_class + '/' : def_params.site_url + '/' + form_class + '/' + param + '/';
     575                                var search_path = ( '' === param ) ? def_params.site_url + '/' + form_class + '/' : def_params.site_url + '/' + form_class + '/' + param + '/';
     576                                if ( '' !== with_param ) {
     577                                        search_path += '?' + with_param;
     578                                }
     579                                location.href = search_path;
    566580                        } else {
    567                                 location.href = def_params.site_url + '/?s=' + param + '&cdb=' + submit_id[1];
     581                                var search_path = def_params.site_url + '/?s=dtbs&cdb=' + submit_id[1];
     582                                if ( '' !== param ) {
     583                                        search_path += '&' + param;
     584                                }
     585                                if ( '' !== with_param ) {
     586                                        search_path += '&' + with_param;
     587                                }
     588                                location.href = search_path;
    568589                        }
    569590
  • detabess/trunk/readme.txt

    r3753085 r3759320  
    33Tags: database, search, data, relation, list, データベース, 検索
    44Requires at least: 4.7.0
    5 Tested up to: 6.8
    6 Stable tag: 2.0
     5Tested up to: 7.1
     6Stable tag: 2.0.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    117117== Upgrade Notice ==
    118118
     119= 2.0.1 =
     120プラグイン付属の CSS を、管理画面でオフにしているときは出さないようにした。旧バージョンから入れ替えたときに出ていた警告を止めた。「すべて」が英語のまま残るのを直した。検索条件が結果に反映されるよう、検索の受け渡しを直した。WordPress 7.1.3 で動作することを確認した。
     121
    119122= 2.0 =
    120123オブジェクト形式への整理、管理画面の権限確認、検索件数の高速化、編集画面が白くなる問題の修正を行いました。
    … …  
    141144== Changelog ==
    142145
     146= 2.0.1 =
     147* プラグイン付属の CSS を、管理画面でオフにしているときは出さないようにした
     148* 旧バージョンから入れ替えたときに出ていた警告を止めた
     149* 「すべて」が英語のまま残るのを直した
     150* 検索条件が結果に反映されるよう、検索の受け渡しを直した
     151* WordPress 7.1.3 で動作することを確認した
     152
    143153= 2.0 =
    144154オブジェクト形式への整理、管理画面の権限確認、検索件数の高速化、編集画面が白くなる問題の修正を行いました。
Note: See TracChangeset for help on using the changeset viewer.