Plugin Directory

Changeset 3391773


Ignore:
Timestamp:
11/07/2025 01:44:22 PM (5 months ago)
Author:
zhuyi
Message:

new version 10.7.9 -- How to Custom Glossary Item Order

Location:
wordpress-tooltips/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wordpress-tooltips/trunk/admin/glossaryglobalsettings.php

    r3338425 r3391773  
    107107    //!!!end 7.5.1
    108108
     109
     110    //!!!start 10.7.9
     111    if (isset($_POST['customglossaryitemorder']))
     112    {
     113        $customglossaryitemorder = sanitize_text_field($_POST['customglossaryitemorder']);
     114        update_option("customglossaryitemorder",$customglossaryitemorder);
     115    }
     116    $customglossaryitemorder = get_option("customglossaryitemorder");
     117    //!!!end   
     118
    109119    //!!!7.6.5
    110120    if (isset($_POST['glossaryNavItemFontSize']))
     
    217227    if (empty($enableGlossarySearchable)) $enableGlossarySearchable = 'yes';
    218228    $bulkremovetermfromglossarylist = get_option('bulkremovetermfromglossarylist'); // !!! 7.5.1
     229    // 10.7.9
     230    $customglossaryitemorder = get_option('customglossaryitemorder');
    219231
    220232    $glossaryNavItemFontSize = get_option("glossaryNavItemFontSize"); //7.7.7
     
    865877<?php
    866878// end 10.5.9
     879//!!! 10.7.9
    867880?>
     881                                        <tr>
     882                                        <td style='width:25%'>
     883                                        <?php
     884                                            $customglossaryitemorder = get_option('customglossaryitemorder');
     885                                            echo __( "Custom Glossary Item Order: ", 'wordpress-tooltips' ).'<span class="spancustomglossaryitemorder">?</span>';
     886                                        ?>
     887                                        <?php
     888                                            $admin_tip = __('You can customize the glossary item order in here, just enter the item IDs, for example: 3,22,58,126,583', "wordpress-tooltips");
     889                                        ?>
     890                                        <script type="text/javascript">
     891                                        jQuery(document).ready(function () {
     892                                          jQuery("span.spancustomglossaryitemorder").hover(function () {
     893                                            jQuery(this).append('<div class="divcustomglossaryitemorder"><p><?php echo $admin_tip; ?></p></div>');
     894                                          }, function () {
     895                                            jQuery("div.divcustomglossaryitemorder").remove();
     896                                          });
     897                                        });
     898                                        </script>
     899                                        </td>
     900                                       
     901                                        <td style='width:25%'>
     902                                        <input type="text" id="customglossaryitemorder" name="customglossaryitemorder" value="<?php echo $customglossaryitemorder;  ?>" placeholder="<?php echo __('for example: 3,22,58,126,583', "wordpress-tooltips");; ?>">
     903                                        </td>                                       
     904
     905                                        <td style='width:25%'>
     906                                        </td>
     907                                        <td style='width:25%'>
     908                                        </td>
     909                                        </tr>
     910
    868911                                        </table>
    869912                                        <br />
  • wordpress-tooltips/trunk/asset/admin/css/admin.css

    r3287898 r3391773  
    2020, span.questionenablegutenbergfortooltips, span.hidezeronumberitemforglossary, span.questionglossaryinnewwindow
    2121, span.questionreadmoreinnewwindow, span.spanquestionglossarycatnameunderterm
    22 , span.questionglossarycategorylink
     22, span.questionglossarycategorylink, span.spancustomglossaryitemorder
    2323{
    2424  cursor: pointer;
     
    5050, span.questionglossaryinnewwindow:hover, span.questionreadmoreinnewwindow:hover
    5151, span.spanquestionglossarycatnameunderterm:hover, span.questionglossarycategorylink:hover
     52, span.spancustomglossaryitemorder:hover
    5253{
    5354    background-color: #21759b;
     
    6162, div.divquestiontooltipforrightcolumnglossarytable, div.divenablegutenbergfortooltips
    6263, div.divquestionglossaryinnewwindow, div.divquestionreadmoreinnewwindow, div.divquestionglossarycatnameunderterm
    63 , div.divquestionglossarycategorylink
     64, div.divquestionglossarycategorylink, div.divcustomglossaryitemorder
    6465{
    6566  text-align: left;
     
    8384, .divquestionglossaryinnewwindow:before, div.divquestionreadmoreinnewwindow:before
    8485.divquestionglossarycatnameunderterm:before, .divquestionglossarycategorylink:before
     86, div.divcustomglossaryitemorder:before
    8587{
    8688  border-color: transparent #21759b transparent transparent;
     
    106108, .divenablegutenbergfortooltips p, .divquestionglossaryinnewwindow p
    107109, .divquestionreadmoreinnewwindow p, .divquestionglossarycatnameunderterm p
    108 , .divquestionglossarycategorylink p
     110, .divquestionglossarycategorylink p, .divcustomglossaryitemorder p
    109111{
    110112  margin: 10px;
  • wordpress-tooltips/trunk/readme.txt

    r3381781 r3391773  
    309309
    310310== Changelog ==
    311 = Version 10.7.3 =
    312 >[Ensure admin.css Loads in wp-admin Only for Tooltip Plugin Screens](https://tooltips.org/load-the-admin-css-file-for-the-wordpress-tooltips-plugin-in-the-wp-admin-area-only-when-the-current-screen-belongs-to-the-plugin-improved-woocommerce-tooltips-wordpress-tooltips-pro-plus-35-7-8-re/)
     311= Version 10.7.9 =
     312>[How to Custom Glossary Item Order](https://tooltips.org/how-to-custom-glossary-item-order-wordpress-tooltips-pro-plus-35-9-8-and-wordpress-tooltips-pro-20-8-4-released/)
    313313
    314314= Version 10.6.9 =
  • wordpress-tooltips/trunk/tooltips.php

    r3381781 r3391773  
    44Plugin URI:  https://tooltips.org/features-of-wordpress-tooltips-plugin/
    55Description: Tooltips for Wordpress,You can add text,image,link,video,radio in tooltips, add tooltips in gallery. More amazing features? Do you want to customize a beautiful style for your tooltips? One Minute, Check <a href='https://tooltips.org/features-of-wordpress-tooltips-plugin/' target='_blank'> Features of Tooltips Pro</a>.
    6 Version: 10.7.3
     6Version: 10.7.9
    77Author: Tomas | <a href='https://tooltips.org/wordpress-tooltip-plugin/wordpress-tooltip-plugin-document/' target='_blank'>Docs</a> | <a href='https://tooltips.org/faq/' target='_blank'>FAQ</a> | <a href='https://tooltips.org/contact-us' target='_blank'>Premium Support</a>
    88Author URI: https://tooltips.org/wordpress-tooltip-plugin/wordpress-tooltips-demo/
     
    19281928       //!!! end 7.9.7
    19291929    }
    1930     update_option('ztooltipversion','10.7.3');
     1930    update_option('ztooltipversion','10.7.9');
    19311931}
    19321932add_action( 'init', 'upgrade_check');
     
    23522352    $sql = $wpdb->prepare( "SELECT ID, post_title, post_content, post_excerpt FROM $wpdb->posts WHERE post_type=%s AND post_status='publish' order by post_title ASC",$post_type);
    23532353    $results = $wpdb->get_results( $sql );
     2354
     2355//!!! 10.7.9
     2356    $customglossaryitemorder = get_option('customglossaryitemorder');
     2357    $customglossaryitemorder_array = array_filter(array_map('intval', explode(',', $customglossaryitemorder)));
     2358   
     2359    if (!empty($customglossaryitemorder_array))
     2360    {
     2361        $id_map = array_combine(wp_list_pluck($results, 'ID'), $results);
     2362
     2363        $ordered = array();
     2364        foreach ($customglossaryitemorder_array as $id)
     2365        {
     2366            if (isset($id_map[$id])) $ordered[] = $id_map[$id];
     2367        }
     2368
     2369        $results = array_merge($ordered, array_diff_key($id_map, array_flip($customglossaryitemorder_array)));
     2370    }
    23542371
    23552372    if ((!(empty($results))) && (is_array($results)) && (count($results) >0))
Note: See TracChangeset for help on using the changeset viewer.