Okay
  Public Ticket #1723355
Actions and hooks not firing at all
Closed

Comments

  • francesa started the conversation

    I am a professional software developer. I purchased your software in the belief that actions and hooks do work as I need this functionality.

    In the first instance after adding a simple call to the functions.php file for my current theme for non of your actions appear to fire even though I do use actions for other plugins.


    Also your documentation is quite scanty regarding the structure of the data you are passing around with your actions and filter functions hence I  do not find this documentation to be sufficient to use these functions.

    I feel there should be a proper reference manual with one simple example per action or filter because this is the usual practice followed by other products being marketed. In fact the standard of documentation for other aspects of your products is extremely high and I was really encouraged until I tried to use actions and filters.

    Please can you either tell me where to look in your php codebase or point me in the direction of where you have documented the structure of the arguments being used by your actions and filters.

    Also please can you confirm that actions and filters do work with your plug-ins I for Wordpress version 4.6.1 and provide me with a simple working example if this is the case.

    Thanks for your help.

  •  471
    Isidora replied

    Hi francesa,
    Thank you for your purchase.

    You can take a look in our documentation  about Actions and Filters which are defined in wpDataTables plugin for customization's by developers.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • francesa replied

    Thanks for getting back Milan.

    I have looked through your documentation already.

    This is why I was able to attempt to call one of your action functions by invoking "add_action" in the functions.php file for my current theme.

    I was easily able to invoke custom action functions for other plugins but was unable to get any action function for wpdatatables to work.

    Any suggestions?

  • francesa replied

    Hello Milan.

    Please can you give me a quote to provide a simple working example for a specific action function which will work with my current theme and version of wordpress.

    Please forward this to my registered email address.

    Thank you.

  •  471
    Isidora replied

    Hi francesa,

    Can you please provide me hooks that you are trying to use and also your custom code that is not working so I can take a look?

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •   francesa replied privately
  •  471
    Isidora replied

    Hi francesa,

    As you can find in our documentation:

    WordPress Actions provide a convenient way to “hook” into different plugins without changing their code. Basically, “actions” are user-defined functions, assigned to certain labels, that are called by the plugin core at defined moments of its execution. Unlike filters, actions do not return any data, they are simply executed.

    You can read more about using WordPress actions and assigning your functions to actions in WordPress Codex. 

    Action and filters are working fine and your code (echo javascript is rendered in json response which you can check in Response on Network tab of browser)(attachment) 

    As is explained in documentation for this action:

    $formdata is the array of keys and values for editing

    Structure of this parametar depends of data in your table so you have to debug it and see what is returned in array of keys and values.

    Please note that using hooks requires certain level of programing skills and included support refers only to advices

    Best regards.


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • francesa replied

    Thanks for all your help Milan.

    With the help of your clarification I was able to get wpdatatables_after_frontent_edit_row to fire as an action and I did print the contents of $formdata. 

    However the problem I now have is how to modify the contents of a field after this action fires so that it is saved back to the database. Is this programmatically possible.

    The real problem I have is that I want to record the user who amended a record without the user specifically entering his user id as an audit trail to anybody who makes changes. I tried setting an integer field to %CURRENT_USER_ID% but this only seems to apply when rows are added. Not when they are amended.

    Any suggestions on how to do this will be welcome.


  • francesa replied

    Hello is there anybody else out there who has any suggestions regarding this problem?

  • francesa replied

    Hello Milan,

    No worries as this issue has now been completely resolved. A painful learning process:-).

    Here is the clue for anybody else interested: 

    add_filter('wpdatatables_filter_frontend_formdata',do_custom_edit',10,2);

  • francesa replied

    Also just to thank you for making available such a powerful and flexible framework.

    But I wish you guys could provide some advanced training courses for which I would gladly pay good money:-).

  •  471
    Isidora replied

    Hi francesa,

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    I am glad that you find solution and that you satisfied with our plugin.

    Thank you for your suggestion.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • francesa replied

    Hello Milan,

    No worries I understand.

    But  I will mention again that I believe your team will benefit from providing paid advanced training which could be delivered online. What are your thoughts on this?

     I have another question for you actually. Now I have got this working I have another problem. 

    I have two fields which I am setting to default values using wpdatatables_filter_frontend_formdata.

    Now I found that in order to set these fields via the filter function they need to have "editor input types" defined.

    But I would like these fields to be read only in the front end of my application. I have hidden them but when the popup dialogue is used to modify values the two hidden fields appear and can then be amended by the user.

    Is there anyway to hide editable fields in the pop up editor by using custom CSS for example?

    Your help will be appreciated.

  •  471
    Isidora replied

    Hi francesa,

    Thank you for your suggestion. I will forward that to my management to think about that.

    For every input in edit modal is generated id based on table id and name of the column. If you have more tables on page you have to add CSS for each table. When you have more tables on page, each one will have specific generated id starting from 1 in odd order(so if you have 3 tables ids will be #table_1,#table_3 and #table_5). So every input in modal have generated id concat with that table id and every input have own label that have "for" attribute like id of that inputwhich you can find with Inspect element of the browser. 

    If you have one table on page and for example you have column name tax then CSS to hide that input and label in edit modal will look like this:

    input#table_1_tax, label[for=table_1_tax] {
    display:none !important;
    }

    About the future question:

    When you are posting on ticket that are not yours or have questions or issues which are not related to the title of the active ticket can you please open a new one, and we will help you there. In that way, issues and questions which are related to different subjects will be in different tickets so other customers or our support agents can find it easily. Our policy is to have one issue or question per ticket because of the reasons that is described already.

    Thank you for understanding.

    Best regards.


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • francesa replied

    Thanks a lot for your helpful response Milan. I will try that out with hiding the fields.

    And yes in future I will open a new ticket with an appropriate title when posting.

    Please also keep me posted on the possibility of any advanced training being made available in the future.

    Best Regards.

  •  471
    Isidora replied

    Hi francesa,

    You are welcome.

    You can subscribe to our newsletter to get notifications about new cool features, promotions, giveaways or freebies. We send about 1 message per month and never spam!

    If you have any more issues or questions feel free to open a new ticket, we will gladly help.

    We'd greatly appreciate it if you could take a minute and leave a Review on CodeCanyon on this link. Thanks! 

    Best regards

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables