Compatibility with Tablepress Plugin?
-
Hi,
I am using WordPress 3.8.1 with Tablepress and revisionary. I love tablepress but am unable to get it to work with the ‘revisionary’ plugin (workflow plugin). Tablepress just seems to ignore it.Do you happen to know if you support tablepress or could be hired to get it to work with revisionary?
Best,
Paul
-
Hi,
thanks for your question, and sorry for the trouble.
Can you explain what you mean with “TablePress seems to ignore it”? What are you expecting to happen and what is happening instead?
Regards,
TobiasHi Tobias!
Thanks for the reply. So revisionary plugin allows certain users to submit changes to published content, with an editor reviewing those changes before publication. It does this using a rudimentary workflow. Users editing pages do not see the ‘publish’ button but rather a ‘Submit for Review’ button. So any changes made to posts or pages are moderated.The issue with tablepress is that it does not work at all with this workflow. I’d love to get wordpress working with revisionary or maybe it already works with another workflow plugin?
Any help you can provide is greatly appreciate.
Best regards,
PaulHi Paul,
thanks for the explanation, now I see what you mean.
Unfortunately, i have bad news here: A workflow like this (where a user edits a table, but the changes in the table will only be visible after an editor approves them) is not possible 🙁 The current implementation does not really allow for this, so I don’t think that I’ll be able to add this in the future. Sorry.
Regards,
TobiasOk. How about a middle ground?
Can you set something up so that a change in a table sends a notification to an admin once the save is submitted?
Is that possible?
-p
Hi,
that should be possible.
I could probably add some more plugin action hooks. With that, one could write some code to e.g. get an email whenever a table is saved.As the next version of TablePress is still some weeks away, I suggest that you meanwhile add this as a custom modification to the TablePress files on your server.
In particular, you could add thisdo_action( 'tablepress_event_saved_table', $table['id'] );after the line 337
$this->_flush_caching_plugins_caches();in the
save()class method in the “models/model-table.php” file.After making that modification, you could then use this, e.g. in the “functions.php” file of your theme or a small new plugin file, to get an email whenever a table is saved:
add_action( 'tablepress_event_saved_table', 'pabrady_tablepress_save_notification', 10, 1 ); function pabrady_tablepress_save_notification( $table_id ) { wp_mail( 'recipient@example.com', 'TablePress table was saved', "The table with the ID {$table_id} was saved." ); }The email address would have to be adjusted as necessary.
Regards,
TobiasHi,
This is great!!!
Two questions:
1. Which files should I add this to. Are both your changes above for this file: “models/model-table.php’?
2. Is it possible to show what the change is when I am notified? Even raw text from the specific row would (along with row # changed) would be great!
Best,
PualHi Tobias!
Your code worked like a charm. I got it to work. Only question now is:
Is it possible to identify the change or just (if easier) spew the entire row that contains the change
and
Can I identify the wordpress user that performed the change? Each user has to have a login ID on our portal to access content and make changes. 🙂
Thanks SO much for your awesome help.
Best regards,
PaulQuick update: I add a few changes to your code to specify user email:
add_action( ‘tablepress_event_saved_table’, ‘pabrady_tablepress_save_notification’, 10, 1 ); // custom change email notification
function pabrady_tablepress_save_notification( $table_id ) {
$current_user = wp_get_current_user();
wp_mail(
‘xxx@gmail.com’,
‘TablePress table was saved’,
“The table with the ID {$table_id} was saved by user {$current_user->user_email}.”Only thing missing now is how to specify the row # of the table that changed and dump the info from that row also so that I get notified by email on both those data points.
That is probably beyond my coding skills 🙂
Let me know what you think! And Thanks!!!
Best,
PaulHi,
great to hear that you got it to work! Nice solution with the user who edited the table, as well! 🙂
Unfortunately, I have bad news regarding the made changes 🙁 As that information is not available during the save request (TablePress only gets the new content of the table and then never cares about the old content — that’s simply overwritten), I don’t see a possibility to show/send the changes in the email. Sorry 🙁
Regards,
TobiasOk. What if we don’t care about the old info? What if all I want is an email that shows me the table id and user email (which we have now) and then shows the row # and new info published only?
That would work for me too! 🙂
-p
Hi,
that’s what I mean 🙂 We don’t have the information about which row was edited and what the new info was. We only have the complete new table.
Regards,
TobiasOh. Sorry. I understand now. Really appreciate your time and effort there Tobias.
Any chance you would be available for some consulting work – customizing the interface for a few workflow like features?
Best,
PaulHi Paul,
I’d love to help with this, but unfortunately my regular day job just doesn’t leave me enough time to take on such customizations 🙁 Besides that, I don’t really know how this could be tackled at all 🙁
I’m really sorry, but you’ll have to live with what we have at the moment.Regards,
TobiasOk. Thank you SO VERY much for all your help and advice. It is greatly appreciated. I hope I wasn’t too much of a pest. 🙂
I love tablepress!!!!
Warm regards,
PaulHi Paul,
no problem, you are very welcome! 🙂 Always happy when I can help!
Best wishes,
TobiasP.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
The topic ‘Compatibility with Tablepress Plugin?’ is closed to new replies.