Okay
  Public Ticket #3548133
Programmatic invocation and display of user-specific graph
Closed

Comments

  • John started the conversation

    Hello, within some PHP code I would like to programmatically invoke and display on a page a wpDataTables chart from the WP database, namely a specific graph which was created by the current logged in user.  How can I do this?  Basically, it would be equivalent to using a shortcode for the graph except within PHP and a specific graph created by the logged in user.  Would I need to cycle through the created charts in your plugin's db table and do it that way in PHP, or is there an easier way to achieve this?

  •  1,819
    Miloš replied

    Hi John,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    We do not have any built-in way to call our Tables or Charts via a PHP code, at the moment with our built-in features you can only use our Plugin's Shortcode to call a Table or a Chart.

    But if you have coding skills, you can try custom workarounds via hooks or PHP code.

    Please note our Support does not cover custom solutions, but i will do my best to try to advise.


    Here is an example if you were to make a custom back-end Page that prints out our Table.

    You can use function wdtOutputTable which is Helper func that prints out the table in backend. 

    Also you have to include all modals(delete, close and edit modal template)

    <!-- /Modals -->
    <?php wdtOutputTable('1'); ?>
    <!-- Delete modal -->
    <?php include WDT_TEMPLATE_PATH . 'common/delete_modal.inc.php'; ?>
    <!-- /Delete modal -->
    <!-- Edit modal -->
    <?php include WDT_TEMPLATE_PATH . 'frontend/modal.inc.php'; ?>


    For printing our a Chart, though, at the moment, we don't have a valid example to show yet, sadly.



    When it comes to built-in options, you can suggest it to our developers- they will do their best to make a solution in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -


    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.


    Please be advised that custom solutions with hooks are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.

    ( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)


    That being said, we are writing down all custom ideas from users and we will do our best to try and add some custom hook examples to our Documenation soon, we will start with the ones most requested from all users, then we hope to work our way through most requests in the future.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    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