customising comments

I'm looking for some help customising WP comments. I expect this is most easily done with WP hooks but this is the most I've done with hooks so far and I haven't yet found the right combination.

The site uses to record and play video. There are a couple lines of script in the header of each page to enable tags that embed a recorder and player.

This tag adds a video recorder to the site:

<camera id="MyFirstCamera" data-app-id="a-aad8cd60-00c7-0134-af93-1217e1551dfd"></camera>

When a video is recorded, it puts a unique VideoID into a hidden input form field:
<input id="MyFirstCamera_video_uuid" type="hidden" name="MyFirstCamera[video_uuid]" value="v-cb6c0062-3324-4d7f-b35f-a7d334415848">

I would like to retrieve the VideoID from the form value and use it to create an HTML tag that retrieves the correct video. I'm guessing JS is the easiest way to retrieve the value, but I'm open to suggestions. This is an example of what I need to generate.
<video id='rando' data-uuid='["v-a08e9e9a-d84d-43ea-9355-ccebceb234c5"]'></video>

This tag should be inserted into the default comment form field and the comment submitted to WP. When visitors view the page of comments, they see video players for each comment submitted instead of text.


The description above is the main priority. The rest of this request, below, can wait if necessary (or go in a separate ticket?).

I would also like to replace the default submit button, though I suspect this could complicate things.

As described above, the user would record a video, click to accept (and save it to, and then have to click the WordPress submit button for it to appear on the site. We'll probably lose a few people who've recorded a video but not submitted it to the site.

It would be better if I could remove the separate submit button and use the 'accept video' button in the embeded recorder. It looks like this could be done with JS events sent from CameraTag, but that's more JS than I know. When a user accepts a video, it triggers a 'published' message. As described above, the VideoID is sent, it is put into the tag, the tag is put into the comment form and submitted to the site.

  • Rupok

    Hi Morgan, hope you had a wonderful day.

    I'm afraid this is totally related with third party software and it's a custom job. We have a Jobs Section for these type of tasks. You can easily hire a developer from there.

    Please keep it in mind, developers found in our Jobs Section are not associated with us. So please communicate with them well before you make any payments to them.

    Have a nice day. Cheers!

  • Morgan

    Hello Rupok,
    Thanks for the very fast reply. I'm sorry but I don't understand.

    I thought I was asking how to use standard WordPress features. Aren't the comment form, hooks, actions and filters standard parts of Wordpress?

    I mention CameraTag for context because I am using it in the site but there is nothing specific to CameraTag about my question. If it helps, I can rephrase this without any mention to CameraTag (however, it would be inconvenient to rewrite it).

    My question is entirely about WordPress and HTML.

  • Rupok

    Hi Morgan, hope you had a wonderful day.

    I'm so sorry my previous answer didn't help you much. This is out of our scope but lemme go above and beyond and try to make this work.

    First of all, you can create a MU Plugin to catch value from the hidden input id "MyFirstCamera_video_uuid" and automatically put it inside the comment box. For creating a mu plugin, create a folder named "mu-plugins" inside your "wp-content" folder. Then inside that "mu-plugins" folder, create a file with any name and with a .php extension. Now paste the code inside that file and save.

    add_action( 'wp_footer', 'auto_add_video_id' );
    function auto_add_video_id() {
        <script type="text/javascript">
          jQuery(document).ready(function() {
    		var text_value = jQuery("#MyFirstCamera_video_uuid").val();
    		jQuery('#comment').val(jQuery('#comment').val()+ '<video id=\'rando\' data-uuid=\'["' + text_value + '"]\'></video>');

    For getting more idea on mu plugins, you can go through this article:

    This will catch value from this code:
    <input id="MyFirstCamera_video_uuid" type="hidden" name="MyFirstCamera[video_uuid]" value="v-cb6c0062-3324-4d7f-b35f-a7d334415848">
    And paste the following line in your comment box automatically:
    <video id='rando' data-uuid='["v-cb6c0062-3324-4d7f-b35f-a7d334415848"]'></video>

    This is done on page load, you can make the event happen with your desired action, like clicking any button, or element.

    If you are stuck at any point, please let us know. We will be glad to assist further.

    Have a nice day. Cheers!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.