• Hello,

    I am having trouble embedding all urls in a table.

    I can embed a single url like this.

    
    <?php
    global $wp_embed; 
    echo $wp_embed->run_shortcode('[embed]https://youtube.com/watch?v=Dg5LGlldNO4[/embed]');
    ?>
    

    I have had a look at the_content and autoembed_callback wordpress hooks, but cant get anything to work.

    I also tried transform but only get the html output. [embed]the url[/embed].

    
    <?php
    require_once(ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CFDBPermittedFunctions.php');
     
    function embedall($entry) {
    	 
        foreach ($entry as $key => $value) {
    	  
            $entry[$key] = ('[embed]' . $value . '[/embed]');
    	  
        }
    	
        return $entry;
    	
    }
    cfdb_register_function('cfdb_reverse');
    ?>
    

    And this example from your documentation. Which also outputs html.

    
    <script>
    $(document).ready(function () {
    
    	$('td[title="url-submit-input"] div').each(	
    		
        function () {
    			
            $(this).html('[embed]' + $(this).html() + [/embed]);
    			
        });
    	
    });
    </script>
    

    Any help would be greatly appreciated.

    The page I need help with: [log in to see the link]

  • The topic ‘Embed urls in table’ is closed to new replies.