Færdiggjort

PHP Code To Replace Shortcode with Images

Hi,

I want some simple PHP code written to replace certain wordpress shortcodes found in html text with this html "<a href="HREF_LINK"><img src="IMGSRC"></a>"

Your code will need to extract or caluclate the "HREF_LINK" and "IMGSRC" parts from the text provided

The shortcodes that I want replaced are:

[embed] youtube and vimeo

[video]

REGARDING YOUTUBE VIDEOS contained within an [embed] shortcode

******************************************************************

e.g.

[embed][url removed, login to view][/embed]

replace with

<a href="[url removed, login to view]"><img src="[url removed, login to view]"></a>

REGARDING IMAGE SOURCE

***************************

Youtube videos have a default image source that you can use, which is simply "[url removed, login to view]<youtube-video-id>/[url removed, login to view]"

In regards to others you can simply use a static image source like "http:\\[url removed, login to view]" this doesn't really matter, use whatever you like as I will change that later anyway

REGARDING VIDEOS - contained within [video] shortcode

**********************************************************

Your code will need to extract the mp4 source

e.g. "[video width="1920" height="1080" mp4="[url removed, login to view]][/video]"

HTML TEXT TO USE:

*************************

For testing purposes you can obviously create your own html text but to assist you here are examples of the shortcodes that I want you to work with

<h2>My Youtube video</h2>

[embed][url removed, login to view][/embed]

<h2>My Vimeo video</h2>

[embed][url removed, login to view][/embed]

<h2>My own In house video</h2>

[video width="1920" height="1080" mp4="[url removed, login to view]][/video]

SUMMARY

**************

I don't want anything complicated something like

$htmltext = '<h2>My Youtube video</h2>

[embed][url removed, login to view][/embed]

<h2>My Vimeo video</h2>

[embed][url removed, login to view][/embed]

<h2>My own In house video</h2>

[video width="1920" height="1080" mp4="[url removed, login to view]][/video]';

$htmltext = replace_sc_with_images($htmltext);

I'm sure you get what I mean

Thanks

Evner: PHP

Se mere: youtube.com whatever you like, whatever you like youtube, whatever you like video youtube, img wordpress, create php code, generating pdf html code php script, mysql php html images uploads, paypal html integration code php, cleanup html code php, form fix page code php html, code project site design php html, html form change detect php code, php code convert html links wikipedia, php html mail code

Om arbejdsgiveren:
( 31 bedømmelser ) Bendigo, Australia

Projekt ID: #8905030

Tildelt til:

MichaelBornand

Hello, I am a webdevelopper since 2010, worked on a lot of website like Meetic (french [login to view URL]), E-commerce, corporate website etc. About your problem, here is a small thing I did in a 15 minutes time, the remain Flere

$25 AUD på 1 dag
(3 bedømmelser)
1.7

4 freelancere byder i gennemsnit $26 på dette job

Johnatangv19

La propuesta todavía no ha sido proveída

$29 AUD in 3 dage
(0 bedømmelser)
0.0
mandeep242

I have more than 3 years experience in php. Working on wordpress theme development and plugin development. great hands on php. give me a try, I will work fast

$25 AUD på 1 dag
(0 bedømmelser)
0.0
samaddahri130

Hi there, I’d like to be considered for your Web Developer. I’m a strategic Developer with a strong background developing Websites and Mobile Applicaions, including MVC,Open source, Wordpress, PHP, Codeigniter, Ph Flere

$25 AUD in 7 dage
(0 bedømmelser)
0.0