Posted: November 15, 2016 at 11:33 am
|
Hello, Recently I have changed the number of options available in the barcode scanner addon. To avoid any issues with the people who use the scanners, we have limited the scannign to “Lookup” and “Checkin”. To do this I have changed the EED_Barcode_Scanner.module.php file to only have the 2 options in the $action_options array. My question is, how do I do this correctly? I have now changed the code, so when the next update happens, the changes will be undone. Thanks |
In order to make that change correctly, there’d first need to be a filter hook there. That’s something we can make a ticket for and assign to a developer. |
|
Hi there, Update: There’s a new filter hook in the most recent release of the ticket scanning add-on. Here’s an example of how to use the new hook:
You can add the above to a functions plugin or into your WordPress theme’s functions.php file. |
|
1. This is in version 2. Will this work for adding actions as well? (are the actions called using |
|
*This is **not** in version |
|
This was actually added in 1.0.10.p, which is the current version of the barcode scanner add-on. WRT your second question, someone could use the filter hook to add more options to the $action_options array. Beyond that, they’d need a way to wire those options up to do new things. |
|
Interesting, I will look in to it. First (and I know this is another ticket) but this system makes it all but impossible to update an add-on via the command-line… :-/ |
|
By “this system” are you referring to the license key system? Since you have access to the github repo, you can update an add-on by cd-ing into its directory and run: If you have suggestions on how to make it possible to serve updates via the command line, that don’t involve using Git, you can open an issue on Github and the developers can investigate further. |
|
Ah, yes. I am actually managing my repos separate from my web directory for security reasons. Also, executing a git-pull would not trigger the update filters, which would be problematic if there were migrations that needed to occur. I will look to see if there are any WP hooks the system can use to determine if an update was requested via WP Cli. |
|
I have created the GH Issue. |
|
The support post ‘How to correctly commit changes to the addons?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.