Okay
  Public Ticket #2980941
remove all from number of records
Closed

Comments

  • Heather Wicksted started the conversation

    Hello. I found a response to the exact question I had, however the code looks different now than it did in 2018. Is there are a new solution to this issue? (Preferably one that doesn't involve having to update the PHP with each update?)


    Thanks. Here is the response: https://tmsplugins.ticksy.com/ticket/1540529/

  •  1,851
    Miloš replied

    Hi, Heather

    Thanks for reaching out to us.

    Sorry, but we still don't have a built-in way of achieving this; and the code did change a bit since that ticket, you are correct. Here is how to remove "ALL" from the selection for the time being:

    Open the same PHP file suggested on that ticket

     ../wp-content/plugins/wpdatatables/source/class.wpdatatable.php ;

    search for this piece of code using CTRL+F :

    $obj->dataTableParams->aLengthMenu

    there are two lines to edit, close to each other, with the same looking code:

    $obj->dataTableParams->aLengthMenu = json_decode('[[1,5,10,25,50,100,-1],[1,5,10,25,50,100,"' . __('All', 'wpdatatables') . '"]]');
    

    6978341064.png

    on both lines, delete these two highlighted section :

    9981739227.png

    ;

    9724277781.png

    so in the end it should look like this :

    $obj->dataTableParams->aLengthMenu = json_decode('[[1,5,10,25,50,100],[1,5,10,25,50,100]]');
    

    6053720069.png

    - Sorry for the inconvenience, but for the time being, that is correct; whenever the plugin updates, you will have to overwrite the PHP code.

    - I will speak to the developers to see if possible to add this as a feature in the future; to have the ability to choose to remove "ALL rows" as a built-in setting.

    You can add your suggestion as well, for this as a built-in feature on this link https://wpdatatables.com/documentation/feature-suggestion/ and our developers would place it on their "TO-DO" list.

    As more customers request a feature, it gets pushed quicker on the list. We always strive to make our product better and deliver the most value to our end users, so we carefully review each suggestion.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Heather Wicksted replied

    This is exactly what I was looking to do and it worked perfectly! Thanks for the updated solution! 

    Heather

  •   Miloš replied privately