Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This is in fact the intended behavior. Those “Custom Commands” could potentially be abused to create security issues by non-admin users, which is why TablePress only allows admins to change them.
    The relevant WordPress capability that is necessary for this is “unfiltered_html”. Note that it’s not a good idea to give this capability to non-admin users, as they can then also add arbitrary HTML code to WordPress posts and pages.

    As it likely does not happen a lot that a user needs to edit these “Custom Commands”, I would suggest that you simply do it with an admin user whenever the commands need to be changed.

    Regards,
    Tobias

    Thread Starter Simon

    (@simoniannelli)

    Thanks for the quick reply Tobias!

    We need this for a specific type of tables with european dates (plugin is installed but dates not detected correctly). Would it be possible to enter the values as admin user as defaults, so that every new table sorts by eu-dates?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you could change the defaults for new tables, but that would require that all of those new tables have the exact same structure (as the columns in the JS code won’t match otherwise). For that, you would need to use some extra PHP code that hooks into the “tablepress_table_template” filter hook.

    Depending on how much you trust the users of your site (and how much JavaScript and HTML knowledge, and possibly malintent towards the site, they have), it might also be an option to just give them the capability. This might not be necessary for very long, as one of the next versions of TablePress will come with a new version of DataTables that won’t need those “Custom Commands” or the Sorting Plugins Extension anymore (it will contain and recognize the format automatically).

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Commands only for admin?’ is closed to new replies.