Jump to content

[Help] Look for a value, and then replace it with another value.


lifetalk

Recommended Posts

Ok... I don't really know how to lay out the subject.. but here is what I am trying to do.

 

Just a side note, this is going to be a wordpress plugin.

 

1. Scan a post for a specific value/string (http://www.google.com , for example).

 

2. Once it finds something similar, replace that entire string with an HTML iframe code. It needs to use the original string in the post in the src part of the iframe code.

 

So basically, the src part of the iframe code is a wildcard that will get replaced by the string that was earlier scanned for.

 

Now, the question is, how do I do it?

A simple starting point would be awesome. I can work my way through the rest.. What's the code for actually scanning the post for a specific string?

 

All help appreciated :)

Link to comment
Share on other sites

You could say that... distantly related though..

I just want it to scan the post for a typical megavideo.com video URL... and then replace the completely URL in the iframe src part.. and paste the complete iframe code replacing the original megavideo url that was typed in the post

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.