Welcome to the Moztools Embedder Plugin Support Forum.
Feel free to post Embedder Plugin-related questions and comments here.
You do not have to register to leave a comment, but I would ask that you check through the list to topic to make sure your question or problem has not already been dealt with.
If you cannot find a suitable topic, then simply create a new one to post your comment.
Hi thomas, thanks for posting. Yeah, I do give a couple of examples in the documentation — but when I have the time I will look to posting some examples. The problem is how to show them since all the action goes on behind the scenes (in the admin section).
I do mention a couple of examples in the documentation page. I use the auto-embeds for the Tweet, Like, and Share buttons on this page (and the others), and the back/forward page links in this section of the web site are also auto-embeds.
However, I get your point, and will look at creating an example page with some real life examples on it soon.
Thank you for your Embedder plugin. It helps a lot!
Today, I find out that after installing the embedder plugin error messages are output in the Apache2 error.log. The message is like this:
[Sun Nov 14 00:15:50 2010] [error] [client 220.247.23.220] PHP Warning: implode(): Invalid arguments passed in /home/kazu634/public_html/wp-content/plugins/embedder/emb-embed.php on line 111
I do not know the PHP language, but something is wrong with emb-embed.php on line 111. The wordpress version is 3.0.1.
Fortunately, the blog is displayed as the plugin and I intend it to be. Only the error messages are output in error.log.
I think I know what the problem is and it should be an easy fix. I will include it in version 0.3 which should be available some time today or tomorrow.
Thanks for letting me know. The hardest thing about developing a plugin is testing every possible scenario, so it’s always nice to get good feedback since makes weeding out the bugs much easier.
One of the most difficult things to test when developing a WordPress plugin, is exactly which versions of WordPress, PHP, and Mysql it will work on. There are so many possible combinations that even with excellent configuration tools like WAMP, it’s tough to cover them all.
So far, I only know for sure that the plugin works with WordPress 3.0.1, PHP 5.2.6, and MYSQL 5.0.5, since those are the software versions I am testing with.
Therefore I would love to hear back from anyone who is running the plugin (successfully or unsuccessfully)—what versions of WordPress, PHP, and Mysql are you running your blog with?
Once I get enough feedback, I will be able to update the documentation with more accurate information.
Would like to remove scrollbars without making chart size huge – the embedder worked fine, but I don’t know how to remove the scrollbars (also, the margin/border is larger on the right than on other sides!!).
Hi there. It’s difficult to help without seeing the chart. Is there any chance you can provide me with link to a web page with the chart on it that shows the problem. If I can look at the HTML, I might be able to see how to tweak it to get what you need. (No guarantees, though!).
I hadn’t heard of the Sniplets plugin before even though I tried to check for similar plugins before I published mine (I didn’t want to reinvent the wheel). There is certainly a fair bit of overlap, though I guess Embedder now has enough unique features to differentiate it.
I’ll be the first to admit that I haven’t spent any time looking into I18N for Embedder yet, but now that the code is reasonably stable and has most of the features I was planning to add, it’s probably a good time to do that.
Sniplets gives me a good place to start—not to steal code from them, of course, but to see what I am doing differently, Hopefully it may be just a case of making sure I am using all the right multi-byte PHP string functions when processing the embed values.
I’ll check into it over the next few days.
Mike
UPDATE: Actually, after a quick look, I can see that the database configuration I am using doesn’t support unicode, which is likely the main problem (there may be others, of course). It looks as though I should be able to fix that pretty easily. What would really help is if you could test the next version of Embedder when it comes out and let me know if that solves the problem, Mike
Well, it was a combination of the database configuration and not specifying the UTF-8 charset when converting the HTML in the value to entities.
The good news is that I can add Chinese characters to an embed and get them to display correctly in a post (not that I know what they say!).
I’ll have to take a look at import/export too, to make sure that will work, but I don’t think you will have to wait too long for an I18N-capable version of Embedder. 🙂
Hmm, that’s an interesting question. As you imply, the answer is always going to be “Yes” but there is also a big “but” to go along with it, of course.
What you are really asking for (I think) is a way for a theme to be able to identify a plugin as a prerequisite and then get WordPress to install it automatically when the theme is installed. I had a quick look around to see if anyone has done this type of thing in a theme, but could not find anything.
There is nothing to stop you from copying the Embedder code and modifying to work in a specific theme (abiding by the licensing rules, of course), but you would have to make quite a lot of changes to the code to make it work as part of a theme and not a plugin, and you would have to update your theme code every time a new version of Embedder was published, if you wanted to keep up with the latest and greatest functionality. So I would advise against this approach.
Therefore I would suggest you look at doing one of following instead:
Make the plugin an optional extra to your theme — tell users that if they installed the Embedder plugin, they would get some extra flexibility or functionality with the theme (and provide them with the link to the plugin’s install page).
Tell users that your theme requires the Embedder plugin to be installed, and if they install the theme without installing the plugin first, pop up a warning message telling them they need to install the Embedder plugin as well.
Include a copy of Embedder in your theme’s files, and when the theme is installed, if the user does not already have Embedder installed, copy the Embedder files into the plugin directory and activate the plugin for them. Then, when a new plugin version comes out, the user will be able to upgrade Embedder like a normal plugin. (You might also want to update your theme’s package with the latest Embedder plugin version, but even if you don’t users will see that an upgrade is available when they next go to the Plugins page.
There is a risk that the plugin directory will not be writable, and you would have to popup some instructions to the user to fix that problem, but I suspect that would not happen very often.
Finally, this would probably be the best way, but also the most work to figure out. When your theme is installed, call the appropriate WordPress APIs to automatically install the Embedder plugin for the user. I don’t know how you would do that exactly, but I am sure the answer is in the WP code somewhere (in the wp-admin/includes/plugins-install.php file probably). This would ensure that the users would always have the latest and greatest version of Embedder.
The first two methods would just require you to detect whether or not the Embedder plugin is installed, which should not be more than a few lines of code, the other two would require quite a lot more code, and you would have to deal with error situations, like the plugin directory not being writable, but it would obviously make the install process easier for users.
So, your question is an interesting question, but I’m afraid that I can’t really do that much to help you since Embedder really is designed as a plugin and it would be too much work for me to get it running as part of a theme instead. In any case, I think your best bet is either to tell users to install Embedder (if you provide the link, it would be no more than two or three extra clicks for users to do it) or perhaps install the Embedder plugin for them if you feel like a bit of hacking!
What I can do, perhaps, is provide a couple of functions that would allow your theme to do things like add, query, and remove embeds, so if the plugin is installed, it can be automatically configured by your theme with a set of embeds that can then be used by the theme. So, for example, you could import a set of embeds into a separate group called something like “XYZ Theme Embeds — Do Not Change!”. Would that be useful?
I’m not sure exactly what you mean. If you could explain a little further, that would help. I don’t really want to have to install other plugins at the moment.
I was afraid of that. But for now I’m very pleased with the embedder, it allows me to address the right css through tinymce. The result is that someone is able to modify a page in the right make up. It doesn’t look good in the wysiwyg editor but the end result is good. It has everything to do with nested div’s and using them.
blok2 w, x
sluit
[blok2 w=”inset” x=”titelt”]Lorum Ipsum[sluit]Blabla[sluit]
when you use the correct class name from your stylesheet it works. The embedd doesn’t get stripped by the editor, would you use <div in the editor all sort of things happen. Being a wysiswyg editor with trouble you can't see it live and the embedd itself does show.
Anyway after trying a few editors with a dozen of hacks and so, I have to say that your plugin is by far! the best solution. Perhaps there is away around, insert the embed but hide the text in the editor. Or to render the embed in the editor, so that you can see what is happening and keep the generated page working as the editor will do it's own thing adding and stripping and that sort of thing.
Does this make any sense?
Well I just started with the embedder and it's fun. If you got any ideas on the tinymce editor thing let me know…
Hey John, I understand exactly what you are talking about. I get frustrated with TinyMCE too — I even wrote a small plugin a couple of years ago that prevented WordPress from stripping out some of the spaces I tried to add (they have since fixed that particular problem so the plugin is no longer useful).
But it’s probably not the editor doing the stripping — it’s the WordPress formatting code — wpautop() and wptexturize() — that does most of that, I think. (It’s difficult to tell without specific examples). And there are at least a couple of plugins that mess around with that type of stuff (since it frustrates other people too) so you might find something that helps if you do a bit of Googling.
As for WSYWYG shortcodes in TinyMCE — that would be nice. TinyMCE does actually have plugins too, so it’s probably possible to do, but unless the other two shortcode issues are solved (adjacent shortcodes, and nested shortcodes) then embeds are always going to be fairly limited when it comes to general formatting, since if they are being used a lot, it’s too easy to get into a mess with those two problems if you’re not aware of the issues.
So I will add it to the feature-wants list — but I can’t say it’s a high priority, because of these problems, and also because it looks pretty complicated!
Regarding editors — have you tried Windows Live Writer? I’m not a big fan of MS in general, but so far Live Writer is the most consistent of the editors I have used, and I’m using the old XP version, which crashes from time to time. Apparently the 2010 and 2011 are even better if you’re using Win7.
If you have installed snaplet, you will find a little box below the post edit area like custom fields box which help people insert shortcode quickly.
To make things better, I suggest embedder offers a similar box with a dropdown list where we can select from available shortcodes and insert one to the editor easyly.
To make things easier, you can add a quick-add field set so we can add shortcode and edit post on the same page!
I think what I suggested wouldnt take much time compare to what you have done.
Thanks for the explanation. It’s an interesting idea, and can see that it would be very useful. I’ll bear it in mind, but as always when writing free code, I can’t promise anything 🙂
No probs. Just as a teaser, I’ve been tinkering with using an alternative to the built-in shortcode parser so that embeds can avoid the two WordPress shortcode limitations altogether — i.e. the problems with nested shortcodes and putting one shortcode directly next to another.
Performance will take a bit of a hit (it will have to use a full parser instead of the limited, but fast, regular expressions WordPress uses today) but I suspect most people won’t notice the difference, and it will make embeds a lot more reliable because users will not keep tripping over those two problems all the time.
Well, actually, Embedder shortcodes can already be nested in shortcodes provided by other plugins — if the other plugins remember recursively call “do_shortcode” on the contents between their tags (which I guess some might not do).
But yeah, one of the side-effects of the new parser will be that Embedder shortcodes will always be processed, no matter where they are, because they will be using a completely separate mechanism.
i really like your embedder plugin but would really appreciate the support of php code in the snippets. is there any way to include this feature? if no, are there alternative plugins which can handle this?
Hey Martin. The main thrust of the plugin is embedding HTML, though I understand that some people would like to have direct embedding of PHP code supported too.
That’s why Embedder does actually support running any PHP code you like in an embed, by specifying a “User Function” in the settings of a global embed (see here for the details).
You do have to put the PHP function somewhere in your code base (the theme’s functions.php file or in a separate plugin — I prefer a plugin since you don’t have any work to do if you change themes), but that shouldn’t take more than a couple of minutes to set up.
The user function’s parameters give you access to the embed’s name (which means you can use the same function with multiple embeds as in the example on the referenced page), the attributes defined in the embed and their values, along with the embed template (value) itself, if it has one, and the content between the begin and end tags — in other words, everything you need.
All your code has to do is return the output you want the embed to display. It might not be quite as convenient as putting the PHP directly in the embed’s value, but it works just the same. This is exactly how I created the page links at the top and bottom of each page in this section, and the index of pages on the Embedder’s home page.
Let me know if you need any help with setting up a user function with an embed, and I would be interested to know if you think this type of PHP support meets your needs (and if not, why not).
As for other plugins, well, there is Sniplets, but I believe it might have a few issues with WP 3.0. That’s all I know of.
thanks for your explanation. i havent seen before that there is a method like you described.
i tried it out and – yes – it seems like it fits my needs quite well..
the only thing i was encountering:
when i put the following into the content of an article >
[my-embed]
text text text
text text text
[/my-embed]
i always have the problem, that linebreaks and paragraphs after the beginning tag and before the end tag are added to the final output. is there a way to avoid this?
i dont want to put in the following >
[my-embed]text text text[/my-embed]
Hi Martin. It sounds to me like WordPress is doing its usual trick of adding extra paragraphs to the output (There are internal functions like “wpautop” that do that, and it can be a real pain if you don’t really want it.)
I’ll take a look to confirm if this is the case, and have a think about how you might avoid the problem, and if there is anything the Embedder can do about it. I’ll post another reply here later.
I just finished playing with a couple of examples, and I can confirm that the problem is WordPress’s automatic formatting functions that add extra line-spacing and paragraphs when generating the output.
The formatting is already done before your embed user function is called (and before Embedder sees it too) so there isn’t really anything the plugin can do to stop it from happening. (And in most cases, it’s what people expect to happen, so automatically removing the formatting would not be a good thing anyway.)
The formatting rules following by the “wpautop” function that does all this is when it sees a single line break it inserts a <br /> tag, and when it sees a double line break, it adds the </p><p> tags. In the WordPress post editor, in Visual Mode, hitting the Enter key gives you a double line break (i.e. a new paragraph) and hitting Shift-Enter gives you a single line break. In HTML Mode if you hit the Enter key once you get a line break, hit it twice you get a new paragraph.
Now, there are a couple of things you can do about thi. The first one is the easiest, but does mess up your formatting a little. Instead of:
[my-embed]
text text text
text text text
[/my-embed]
You could do:
[my-embed]text text text
text text text[/my-embed]
(assuming you want that line break in the middle of the “text” content.)
If that’s not good enough, then you have to strip the tags you don’t want from the output between the tags in your embed function. There are a different ways to do this depending on what you want:
If you want to strip all the formatting from the content you can do this:
function my_em($name, $value, $attrs, $content) {
$content = str_replace(array('<br />', '<p>', '</p>'), array('', '', ''), $content);
return $content; // Note you have to return the modified content for this to work.
}
If you only want to strip the first “p” or “br” and the last “p” or “br” you have to use a regular expression:
function my_em($name, $value, $attrs, $content) {
$content = preg_replace('/^s*<brs*/>|^s*</p>|<brs*/>s*$|<p>s*$/', '', $content);
return $content; // Note you have to return the modified content for this to work.
}
(Regular expressions are complicated mess, but I have tested the one above and it does work. It looks for “br” and “p” tags only at the beginning (^) or end ($) of the content and replaces them with an empty string, and leave all the other line breaks and paragraphs alone.)
Please note, that if your embed has a value (template), like this:
<b>%content%</b>
You will have to insert the stripped content (in the $content parameter) into the template yourself and return the whole thing from your function, otherwise the embed will just take the original content. You can do that like this:
That’s the best I can offer. Your function has to do the work to strip out those extra formatting tags, I’m afraid. The only other alternative would be to turn off “wpautop” altogether (just Google for “wpautop” to see how you can do that) but you would then have to add all the line breaks and paragraphs manually, which I doubt is what you want.
Hi Make, you mentioned earlier that one shortcode can be nested in the another if only the plugin “call do_shortcode on the contents between their tags”. Can you tell me how to modify current version of embedder so it can be able to parse shortcode in the value? I really want that. Thanks in advance.
Sure — but if you can you give me an example of what you want to do, that would help.
Do you want to do this:
(1) [shortcode] Some text [embed] More text [/shortcode]
Or this:
(2) [embed] Some text [shortcode] More text [/embed]
I think, from you previous questions, it is (1) — you want to use Embedder embeds inside a shortcode provided by another plugin, correct?
If that is the case, is the text (a) between the tags ([shortcode]…[/shortcode]) in the post text (i.e. did you type it in with the editor) or is it (b) generated by another plugin (i.e. automatically inserted by the plugin)?
If it is (a) then you are in luck. The new parser I will be adding to Embedder in the next version will process all the embed tags before any other shortcodes are processes, which means that embeds nested inside other shortcodes will work automatically.
If it is (b), and the other shortcode is inserting an embed into the text, that will not work at the moment — but there is probably a way to make it work, by delaying the processing of the embeds until *after* the shortcodes are processed, which could be an option.
So if you can give me an example of exactly what you are trying to do, that would help me figure out if the new parser will help you or not.
Hi, what I want is more like (b). For example, I define a new embedder shortcode [a], and in the value field of [a] I have “some text and some text”. is provided by another plugin and is a form. So by simply putting [a] in my post I want this output “some text (a form) and some text”.
why [b] is filtered out in my previous comment? I will try another way:
For example, I define a new embedder shortcode [a], and in the value field of [a] I have “some text [b] and some text”. [b] is provided by another plugin and is a form. So by simply putting [a] in my post I want this output “some text (a form) and some text”.
Your embed is [xyz] and the other plugin’s embed is [form].
In the value for [xyz] put:
“Some text %content% some more text”
(In other words, don’t put [form] in the value, put the attribute %content% there instead.)
Then in your post, you can put [xyz] [form] [/xyz] (but remember to leave a space between the shortcodes or it won’t work!) and then when [xyz] is processed, the nested [form] shortcode will be processed and you will get the form.
That might be a little too messy for you, so if you just want to have one [xyz] tag and keep the [form] in the embed value, you can add a small user function instead.
function my_embed_function($name, $value, $attrs, $content) {
// This will allow [form] to be processed.
return do_shortcode($value);
}
You have to add the function to WordPress — the best place is usually in the functions.php file in your theme, but another plugin will also do. (And remember to add the user function name into the settings of your embed.)
Or, you can wait for the next version of the plugin (sometime in the next two weeks) and because the new parser will process embeds *before* shortcodes, it should work automatically. 🙂
thanks for your explanation!
right now i managed the problem in the way that i put the following code into the content.
[my-special-div]
text text text
text text text
[end-div]
this works in my case quite well. when i encounter the need of wrapping content into a start and end tag i will try your solution. i just read about the new parser from version 1.3 – does it change anything to this odd behaviour from wpautop?
I just installed this plugin (v 1.31) for the first time today. No matter what I add in the fields, I get the following error when I click on the “Add Embed” button:
Fatal error: Cannot pass parameter 1 by reference in /wordpress/wp-content/plugins/embedder/emb-admin.php on line 214
WordPress version : 3.02
Linux ISP
Apache 1.3.41
PHP 5.2.5
MySQL 5.0.81
Well, I’m not entirely sure why the line 214 was causing a problem for some people—I’m pretty sure I tested it with PHP4 and PHP5—ah well, it happens, I guess.
I removed the issue altogether by removing what was a little bit of a lazy hack in the first place, with an even lazier (but much safer) hack :).
So if you happen to read this note, stephane and Martin, if you could try version 1.3.2 and let me know if it solves your problems, I would be very grateful!
Hey Mike,
Just wanted to let you know I put the new 1.3.2. plugin to use this morning and it works flawlessly. I used the new parser mode, and 5 attributes to embed Scribd docs in Flash. Your plugin is a life saver!
One quick minor note: on your website it says that “When you use attributes with global embeds, the plugin identifies the attributes you have used in an embeds and displays them in attributes column in the table.” It seems only the first attribute is shown, which is fine, but it would be nice to see them all. If not in the table, maybe in the “Edit Embed” page?
Hi Stephane, glad you’re enjoying the plugin, and thanks for the feedback. It’s nice to know things are working well.
Yeah, I know about the attributes in the table — I actually print them all out, but because I don’t allow enough space in the column in the table, if there’s more than one or two, the rest overflow the column and are not displayed. I’ve been meaning to tweak the column widths to fix it, so I’ll probably do it in the next version. (I probably shouldn’t put out any more updates for a few days, though, having had three in three days 🙂 )
I really like Embedder because it makes coding and creating pages a lot easier, thanks!
However I think I encountered a problem: When I use Embedder and another plugin called Hackadelic Sliding Notes – btw its syntax goes like this: [slider title=”push me”]content[/slider] – is activated the “content” isn’t displayed anymore so basically the sliding plugin stops working. Without Embedder everything is fine, so I thought this might be a bug?
Infos: I’m using WP 3.0.3 and your is parsing method enabled…
Thanks for the information, Rumli. It does sound as though the two plugins are not behaving well together. I’ll take a look when I get the chance, later, to see if there is anything I can change in the Embedder to resolve the issue.
that it’s working okay (the slider expands, and the colors are set to red (outside the slider tags) and green (inside), so in principle, I think the two plugins should work together fine (if you use the new parser — the old parser does not see the embed inside the slider tag, but that’s probably a problem with the Slider Plugin, not Embedder :-).
Soo… I will probably need more information if I have any chance of resolving your problem.
— Is the content missing even if you don’t have any embeds on the page?
— I assume you do not have an embed called “slider” — that would certainly cause problems!
— Have you looked at the source code of the generated page (Ctrl-U on Firefox) to see if the content of the sliders are completely missing, or just not showing up?
I’m not quite sure what’s going on, honestly. I looked at the slider code, and nothing jumped out at me as being a problem — he is just using a standard shortcode, which should be fine.
If you can give me an example of a slider that is having the problem (or perhaps a link to a page with one on it), that might help too.
Unfortunately I can’t give you a test link because my page isn’t officially online yet (currently I’m just switching my old index.php with the wp one for a few minutes ;-)).
But I can try to give you as much information as possible: Embedder and “Slider” are used on the same page but not mixed as in your example. I use local embeds (for images in a table) and a global one. The slider is inside a table cell like this: “[slider title=””][/slider]” and no content is added to the page – I think that’s the problem because I can see Slider to start moving (trying to show something). The following is simply missing at the very bottom of the page:
CONTENT
I disabled ever other plugin (except qTranslate) and the problem persists. What else can I say…I’m using jQ as my theme with jQuery from google (using deregister, register, enqueue in functions.php (took me pretty long to find out how I could stop wp and jQ from loading the included script but it seems to work just fine now)).
I don’t think JQuery is a problem, since Embedder doesn’t use JQuery (except in the admin pages), and being in an HTML table shouldn’t be a problem either. I still don’t see what the problem could be.
All I can suggest now is for you to send me and email with the following attachments:
— the source of a page with the bug (i.e. edit the page with the HTML editor in WordPress and cut and paste it into a file and attach that file to the email.)
— the output of that page in the browser (i.e. save the page in the browser — HTML only, don’t need the images — and also send it to me as an attachment.
Then I can see what how the page is being transformed.
Send these files to mike@moztools.com and I’ll take a look at them, though I will be quite busy between now and Christmas, so I can’t promise I will get to them quickly.
In my e-mail I said that I will check if uncommenting my changes to Slider will change anything. Well, I just tested it and didn’t help. In the post above I also said that I disabled all plugins but qTranslate – just did it as well and didn’t help either…I hope you find a quick solution.
Anyway, I think I just found another small “bug”: It is possible to use attributes in the “Wrap Embed” option fields but those won’t be displayed in the overview page.
Thanks, I have the email — and yes, the plugin doesn’t look in the wrapped fields for attributes at the moment. Noted.
Okay, figured out the problem — I should have noticed this before, it’s not really a bug in either plugin, it’s just that we’re playing around with the same WordPress filter — ‘the_content’ — which is why Embedder is causing a problem for Slider:
In hackadelic-sliding-notes/hackadelic-sliders.php you have this:
The numbers are the order in which the filters are called. The shortcode filter — the one that does the main substitution for Slider, is normally priority 11, and Slider expects it to have been called before its “postProcessContent” filter is called, at priority 12. But, as you can see, Embedder moves the shortcode filter to priority 15, which messes things up.
I have my reasons for doing this (but it would take too long to explain), and when I did it I remember wondering if it might cause problems down the road (but of course I forgot about it). WordPress doesn’t help because most of the existing filters using “the_content” are clustered tightly around priority 10 (and you cannot guarantee the ordering with filters with the same priority) so plugins have no room to insert their own filters between existing ones, which is why I move the “do_shortcode filter”.
Anyway, to fix this problem, all you have to do is adjust the priorities again. I suggest, since you have already modified Slider, and you will probably want the next version of Embedder when it comes out :-), that you change Slider rather than Embedder. (But it’s up to you, of course).
In hackadelic-sliding-notes/hackadelic-sliders.php just change this line:
and it should all work again for you. (BTW: You do not need to change the “widget_text” line, even if you use sliders in widgets.)
I may have to add an option to Embedder to allow users to change the order in which things are done, to help prevent this type of problem, but I will have to think about how best to do that.
Thanks for feedback. And I hope the workaround works for you. Please let me know how you get on.
It works! Thank you very much Mike, I really appreciate your help.
If you have a possibility to receive donations, I would like to give you some of my spare dollars… 🙂
Thanks, Rumli. I’m glad it works. I might have to add something like a compatibility mode option, one where Embedder doesn’t mess with the priority of the filters.
And thank you for your kind offer of a donation. I haven’t gotten anything set up yet, so don’t worry about it right now. I will set something up over the next two or three weeks, and if you happen to remember to donate after that, that’s great otherwise, no worries.
I’m looking forward to your new releases of this excellent plugin and I really think you deserve more attention on wordpress because I tested some others (more popular ones) and think that yours is the best!
Yes, a compatible option is probably needed but for now a small note on the installations notes or whatever would be enough I think.
You’re too kind! It does take time to build a reputation, but I believe the better plugins usually get noticed in the end – the number of daily downloads usually picks up after each release as more and more functionality is added.
I was hoping to get the next version out before Christmas — one that adds a metabox to the edit post/page pages containing buttons for inserting your embeds into the editor, but with all the differences between the various browsers, it’s proved to be more difficult to get right than I thought. It should be a nice addition when it’s done.
I’ve also been working on a plugin to turn any comment thread into a forum (Instant Forums — you’re looking at it now, it case you didn’t notice! 🙂 ) I suspect that one will take off faster than Embedder, because it’s cool feature you can instantly enhance your blog with (hence the name). It’s especially useful for low traffic, single issue support forums like this one, which is why I created it in the first place. I’ve tried supporting code before on regular blog comment threads and it becomes a real pain after a while.
This is a great plug-in and enables me to allow the client to add formatting without having to use the html view, which causes panic.
It works great if I don’t check the “Use the embedded parser” option. But if I enable the parser, I get the following error when trying to view the page:
Fatal error: ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers in C:xampphtdocswordpresswp-contentpluginsembeddernbbc-1.4.5nbbc.php on line 1442
Hello, I am trying to add a link in my sidebar widget to my “Helpful Information” page. Will embedder allow me to do this and if so how? I want to create a embed named [click] here for more information, that when clicked on takes the user to my Helpful Information page.
Thanks, Dave
I use a WP blog including 2 plugins for my posts. The first one is a picture viewer and the second one is a tabs plugin for a bettter look of my posts. But when I try to use the plugin to embed my posts for other blogs who don’t have my picture viewer and my tabs plugins, the embedder doesn’t detect them and the posts have a very bad look. Is there a solution for this?
When using this great plugin to make it easier for volunteers in my church to add HTML to podacst posts, we’ve hit a challenge when using the new embedder parser. If this is enabled and somebody comments on the post, the comment is submitted successfully, but the user is presented with an error (note: paths edited for security):
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-comments-post.php on line 95
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-comments-post.php on line 96
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-comments-post.php on line 97
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-includes/pluggable.php on line 897
Using WP 3.1.2 with Genesis Theme Framework (v1.6).
Note that the issue is fixed by simply disabling the new parser, although I’m not sure this is the best way forward…
The Embedder plugin is great, but only Admins can access the admin page. I have a bunch of Editors that need to use Embedder, but they cannot create new embeds or access old ones.
It’s me again. A half year has passed now and I just want to let you know that I’m still succesfully using your great plugin. Please don’t stop creating new features… Embedder is still loved by thousands! 🙂
Hi! Awesome plugin. Gets the work done. Although it seams not to embed php properly. I’m getting the php code displayed instead of the function. 🙂 After what I understand that the arguments is processed after the php code is processed, so how wouold I go about displaying a md5 checksum in an embed?
Hi Johan — the Embedder plugin doesn’t support embedding of PHP directly. What you can do though is call a PHP function you create when the embed is found. The details on how to do that are on this web page:
I turned on the embedded parser without any other changes, so I could see what it would do, and this is what I get:
Fatal error: ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers in /home/content/92/8274492/html/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1442
It seems this only occurs on single post pages and stand-alone pages and not on the home page or a category page.
Seems like you dropped development on the Embedder plugin 🙁
No updates and posts in the support forum for a long time…
Well, if you once restart further development, please keep in mind that the new embedder parser won’t call user functions anymore. Tried everything as suggested but the defined user functions only seem to work with the old parser…
Hi. I’m just trying out the Embedder plugin. It looks like a great plugin, but I can’t get it to work as expected.
1) Checking the “Use the new Embedder parser” seems to do nothing. It doesn’t stay checked (there is no ‘save’ settings button). Each time I return to the Manage Embeds screen it is unchecked again.
2) Checking the “Wrap the HTML in a div or span” doesn’t allow me a place to select div or span, and doesn’t offer a place to add classes. Then in the output the result is:
my content
Rather than
3) I created an Embed named check_out_link with the content shown below using a shortcode from another plugin inside an Embed (using j-shortcodes to create a button), along with some PHP for another conditional link:
I’m sticking the Embed shortcode [check_out_link] inside an Advanced Text Widget which supports shortcodes from many other plugins.
The output is that the actual j-shortcodes shortcode is printing to the screen rather than rendering. In addition, it is bracketted by “” quotes in the output (renders that way with or without the wrap applied):
is it possible to create global embeds without utilizing the admin interface/the underlying database? Having to provide a large blog network with the same shortcodes manually managing each one of them becomes impractical, when you also wanna add addtional shortcodes from time to time and have them in sync across all blogs.
Using an additional plugin or a parent themes function.php feels like a solution. Is it possible to do this using Embedder, as it is with the native WP shortcodes? Thanks in advance for any help!
I just embedded the html for a flash presentation into my site, but it does not appear in the page. What is really weird is that when scrolling down the page, I can see a narrow strip of the graphic that I want to show up in there. As someone without enough knowledge of flash or javascripts to find the problem myself, I was wondering if anyone has seen this before of may offer a solution?
I’ve tried using different sections of the HTML from the source page, so currently it has a lot of ugly broken image links etc that I can remove later. For now I’m just trying to get the map.
Any help would be very much appreciated. I’m still learning, and unfortunately this one has me stumped.
Embedder works realy nice. I managed to do what I needed.
But there is one issue.
I want to post some instructions for users how to use embed tags, but I cannot because each tiem I use tag it gets parsed.
I had to use & #91 ; and & #93 ; instead of brackets to make tags displayed and not parsed.
It would be nice to have option to marks block of text where Embedder will not parse contents.
I had strange problem: each time user posts comment he receives error caused by Embedder:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/pedja/public_html/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106
I noticed this happens only for blog visitors. If logged in user posts comment, there is no error.
Fix was simple, I checked if parameter is array before using it so I avoided error.
Here is code fix
function AddRules($rules) {
if (is_array ($rules)) {
$this->tag_rules = array_merge($this->tag_rules, $rules);
}
}
I guess you would like to investigate this further and fix in new release.
PHP Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/waterway/public_html/alrewasplan.co.uk/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106
Hi, I’m having an issue with Embedder breaking other ads and JS.
All of a sudden, I noticed that my 160×600 sidebar ad (media.net,) my 468×60 ad in the header (media.net) weren’t being displayed and the 300×250 in the sidebar (Avantlink) was being pushed down to the very bottom left of the page. This is all when on a single post (on single pages and homepage it’s fine.) The embedded in-content 468×60 and 300×250 ads for Adsense were working, but not for media.net (split testing through oiopublisher) and the script for Infolinks wasn’t running on single posts either.
When I disable Embedder, all works fine (except of course the embedded ads.)
Welcome to the Moztools Embedder Plugin Support Forum.
Feel free to post Embedder Plugin-related questions and comments here.
You do not have to register to leave a comment, but I would ask that you check through the list to topic to make sure your question or problem has not already been dealt with.
If you cannot find a suitable topic, then simply create a new one to post your comment.
Thanks,
Mike Walker
Sounds good. A demo page with a couple of embeds would be nice.
Hi thomas, thanks for posting. Yeah, I do give a couple of examples in the documentation — but when I have the time I will look to posting some examples. The problem is how to show them since all the action goes on behind the scenes (in the admin section).
I do mention a couple of examples in the documentation page. I use the auto-embeds for the Tweet, Like, and Share buttons on this page (and the others), and the back/forward page links in this section of the web site are also auto-embeds.
However, I get your point, and will look at creating an example page with some real life examples on it soon.
Mike
Okay, I have just added a couple of easy to follow detailed examples of how to use embeds. More to follow.
Thank you for your Embedder plugin. It helps a lot!
Today, I find out that after installing the embedder plugin error messages are output in the Apache2 error.log. The message is like this:
[Sun Nov 14 00:15:50 2010] [error] [client 220.247.23.220] PHP Warning: implode(): Invalid arguments passed in /home/kazu634/public_html/wp-content/plugins/embedder/emb-embed.php on line 111
I do not know the PHP language, but something is wrong with emb-embed.php on line 111. The wordpress version is 3.0.1.
Fortunately, the blog is displayed as the plugin and I intend it to be. Only the error messages are output in error.log.
Hi kazu634, thanks for the good feedback.
I think I know what the problem is and it should be an easy fix. I will include it in version 0.3 which should be available some time today or tomorrow.
Mike
To Mike
Thanks for your fix.
After installing version 0.3, the error messages are no longer output in the error.log.
Again, thank you for your quick fix release!
Kazuhiro MUSASHI
Thanks for letting me know. The hardest thing about developing a plugin is testing every possible scenario, so it’s always nice to get good feedback since makes weeding out the bugs much easier.
One of the most difficult things to test when developing a WordPress plugin, is exactly which versions of WordPress, PHP, and Mysql it will work on. There are so many possible combinations that even with excellent configuration tools like WAMP, it’s tough to cover them all.
So far, I only know for sure that the plugin works with WordPress 3.0.1, PHP 5.2.6, and MYSQL 5.0.5, since those are the software versions I am testing with.
Therefore I would love to hear back from anyone who is running the plugin (successfully or unsuccessfully)—what versions of WordPress, PHP, and Mysql are you running your blog with?
Once I get enough feedback, I will be able to update the documentation with more accurate information.
Thanks,
Mike
Would like to remove scrollbars without making chart size huge – the embedder worked fine, but I don’t know how to remove the scrollbars (also, the margin/border is larger on the right than on other sides!!).
Hi there. It’s difficult to help without seeing the chart. Is there any chance you can provide me with link to a web page with the chart on it that shows the problem. If I can look at the HTML, I might be able to see how to tweak it to get what you need. (No guarantees, though!).
Mike
great features but couldnt handle language like chinese. when there are chinese characters the value can not be saved properly.
sniplets handles well which is what I have to use now.
Hi Phil, thanks for your comment.
I hadn’t heard of the Sniplets plugin before even though I tried to check for similar plugins before I published mine (I didn’t want to reinvent the wheel). There is certainly a fair bit of overlap, though I guess Embedder now has enough unique features to differentiate it.
I’ll be the first to admit that I haven’t spent any time looking into I18N for Embedder yet, but now that the code is reasonably stable and has most of the features I was planning to add, it’s probably a good time to do that.
Sniplets gives me a good place to start—not to steal code from them, of course, but to see what I am doing differently, Hopefully it may be just a case of making sure I am using all the right multi-byte PHP string functions when processing the embed values.
I’ll check into it over the next few days.
Mike
UPDATE: Actually, after a quick look, I can see that the database configuration I am using doesn’t support unicode, which is likely the main problem (there may be others, of course). It looks as though I should be able to fix that pretty easily. What would really help is if you could test the next version of Embedder when it comes out and let me know if that solves the problem, Mike
Well, it was a combination of the database configuration and not specifying the UTF-8 charset when converting the HTML in the value to entities.
The good news is that I can add Chinese characters to an embed and get them to display correctly in a post (not that I know what they say!).
I’ll have to take a look at import/export too, to make sure that will work, but I don’t think you will have to wait too long for an I18N-capable version of Embedder. 🙂
Mike
Would it be possible to move from a plugin to a theme (ofcourse, cause we can hack the shit out of wordpress). And if so how can I do that?
thanks
Ubuntu Linux 10.10
Apache version 2.2.16
MySQL version 5.1.49
5.3.3-1ubuntu9.1
wordpress 3.1-beta1-16590
It runs on virtualbox on a windows 7 os.
Thank you John! Good to know it’s running okay on the 3.1 beta 🙂
Hmm, that’s an interesting question. As you imply, the answer is always going to be “Yes” but there is also a big “but” to go along with it, of course.
What you are really asking for (I think) is a way for a theme to be able to identify a plugin as a prerequisite and then get WordPress to install it automatically when the theme is installed. I had a quick look around to see if anyone has done this type of thing in a theme, but could not find anything.
There is nothing to stop you from copying the Embedder code and modifying to work in a specific theme (abiding by the licensing rules, of course), but you would have to make quite a lot of changes to the code to make it work as part of a theme and not a plugin, and you would have to update your theme code every time a new version of Embedder was published, if you wanted to keep up with the latest and greatest functionality. So I would advise against this approach.
Therefore I would suggest you look at doing one of following instead:
There is a risk that the plugin directory will not be writable, and you would have to popup some instructions to the user to fix that problem, but I suspect that would not happen very often.
The first two methods would just require you to detect whether or not the Embedder plugin is installed, which should not be more than a few lines of code, the other two would require quite a lot more code, and you would have to deal with error situations, like the plugin directory not being writable, but it would obviously make the install process easier for users.
So, your question is an interesting question, but I’m afraid that I can’t really do that much to help you since Embedder really is designed as a plugin and it would be too much work for me to get it running as part of a theme instead. In any case, I think your best bet is either to tell users to install Embedder (if you provide the link, it would be no more than two or three extra clicks for users to do it) or perhaps install the Embedder plugin for them if you feel like a bit of hacking!
What I can do, perhaps, is provide a couple of functions that would allow your theme to do things like add, query, and remove embeds, so if the plugin is installed, it can be automatically configured by your theme with a set of embeds that can then be used by the theme. So, for example, you could import a set of embeds into a separate group called something like “XYZ Theme Embeds — Do Not Change!”. Would that be useful?
Hi Mike, glad to know that you are working on it. I am going to test the new release now 🙂
Problem solved,Cheers!
BTW, an easy access box on the post writing page will be a hug advantage over sniplet which has a very simple box and a botton on the editing page.
What Affiliate Link implemented is a good reference which I dont know why dispear in the wp plugin catlog but you can find it here http://svn.wp-plugins.org/affiliate-link1/trunk/
sorry for the misspelling of huge button catalog …
I’m not sure exactly what you mean. If you could explain a little further, that would help. I don’t really want to have to install other plugins at the moment.
Mike
I was afraid of that. But for now I’m very pleased with the embedder, it allows me to address the right css through tinymce. The result is that someone is able to modify a page in the right make up. It doesn’t look good in the wysiwyg editor but the end result is good. It has everything to do with nested div’s and using them.
blok2 w, x
sluit
[blok2 w=”inset” x=”titelt”]Lorum Ipsum[sluit]Blabla[sluit]
when you use the correct class name from your stylesheet it works. The embedd doesn’t get stripped by the editor, would you use <div in the editor all sort of things happen. Being a wysiswyg editor with trouble you can't see it live and the embedd itself does show.
Anyway after trying a few editors with a dozen of hacks and so, I have to say that your plugin is by far! the best solution. Perhaps there is away around, insert the embed but hide the text in the editor. Or to render the embed in the editor, so that you can see what is happening and keep the generated page working as the editor will do it's own thing adding and stripping and that sort of thing.
Does this make any sense?
Well I just started with the embedder and it's fun. If you got any ideas on the tinymce editor thing let me know…
thanks
Hey John, I understand exactly what you are talking about. I get frustrated with TinyMCE too — I even wrote a small plugin a couple of years ago that prevented WordPress from stripping out some of the spaces I tried to add (they have since fixed that particular problem so the plugin is no longer useful).
But it’s probably not the editor doing the stripping — it’s the WordPress formatting code — wpautop() and wptexturize() — that does most of that, I think. (It’s difficult to tell without specific examples). And there are at least a couple of plugins that mess around with that type of stuff (since it frustrates other people too) so you might find something that helps if you do a bit of Googling.
As for WSYWYG shortcodes in TinyMCE — that would be nice. TinyMCE does actually have plugins too, so it’s probably possible to do, but unless the other two shortcode issues are solved (adjacent shortcodes, and nested shortcodes) then embeds are always going to be fairly limited when it comes to general formatting, since if they are being used a lot, it’s too easy to get into a mess with those two problems if you’re not aware of the issues.
So I will add it to the feature-wants list — but I can’t say it’s a high priority, because of these problems, and also because it looks pretty complicated!
Regarding editors — have you tried Windows Live Writer? I’m not a big fan of MS in general, but so far Live Writer is the most consistent of the editors I have used, and I’m using the old XP version, which crashes from time to time. Apparently the 2010 and 2011 are even better if you’re using Win7.
If you have installed snaplet, you will find a little box below the post edit area like custom fields box which help people insert shortcode quickly.
To make things better, I suggest embedder offers a similar box with a dropdown list where we can select from available shortcodes and insert one to the editor easyly.
To make things easier, you can add a quick-add field set so we can add shortcode and edit post on the same page!
I think what I suggested wouldnt take much time compare to what you have done.
Best regards,
Phil
Thanks for the explanation. It’s an interesting idea, and can see that it would be very useful. I’ll bear it in mind, but as always when writing free code, I can’t promise anything 🙂
I have switch to embedder now and looking forward to some user-friendly improvement. Thanks anyway!
No probs. Just as a teaser, I’ve been tinkering with using an alternative to the built-in shortcode parser so that embeds can avoid the two WordPress shortcode limitations altogether — i.e. the problems with nested shortcodes and putting one shortcode directly next to another.
Performance will take a bit of a hit (it will have to use a full parser instead of the limited, but fast, regular expressions WordPress uses today) but I suspect most people won’t notice the difference, and it will make embeds a lot more reliable because users will not keep tripping over those two problems all the time.
Anyway, watch this space 🙂
cool, if embedder shortcode can be nested in shortcode provided by other plugin that would be great!
Well, actually, Embedder shortcodes can already be nested in shortcodes provided by other plugins — if the other plugins remember recursively call “do_shortcode” on the contents between their tags (which I guess some might not do).
But yeah, one of the side-effects of the new parser will be that Embedder shortcodes will always be processed, no matter where they are, because they will be using a completely separate mechanism.
hi,
i really like your embedder plugin but would really appreciate the support of php code in the snippets. is there any way to include this feature? if no, are there alternative plugins which can handle this?
greetings, martin
Hey Martin. The main thrust of the plugin is embedding HTML, though I understand that some people would like to have direct embedding of PHP code supported too.
That’s why Embedder does actually support running any PHP code you like in an embed, by specifying a “User Function” in the settings of a global embed (see here for the details).
You do have to put the PHP function somewhere in your code base (the theme’s functions.php file or in a separate plugin — I prefer a plugin since you don’t have any work to do if you change themes), but that shouldn’t take more than a couple of minutes to set up.
The user function’s parameters give you access to the embed’s name (which means you can use the same function with multiple embeds as in the example on the referenced page), the attributes defined in the embed and their values, along with the embed template (value) itself, if it has one, and the content between the begin and end tags — in other words, everything you need.
All your code has to do is return the output you want the embed to display. It might not be quite as convenient as putting the PHP directly in the embed’s value, but it works just the same. This is exactly how I created the page links at the top and bottom of each page in this section, and the index of pages on the Embedder’s home page.
Let me know if you need any help with setting up a user function with an embed, and I would be interested to know if you think this type of PHP support meets your needs (and if not, why not).
As for other plugins, well, there is Sniplets, but I believe it might have a few issues with WP 3.0. That’s all I know of.
Cheers,
Mike
Glad to know that. If you can let the user choose which mechanism they want to use it will be a very user-friendly option.
hi mike,
thanks for your explanation. i havent seen before that there is a method like you described.
i tried it out and – yes – it seems like it fits my needs quite well..
the only thing i was encountering:
when i put the following into the content of an article >
[my-embed]
text text text
text text text
[/my-embed]
i always have the problem, that linebreaks and paragraphs after the beginning tag and before the end tag are added to the final output. is there a way to avoid this?
i dont want to put in the following >
[my-embed]text text text[/my-embed]
because it doesnt look that good..
greetings, martin
Hi Martin. It sounds to me like WordPress is doing its usual trick of adding extra paragraphs to the output (There are internal functions like “wpautop” that do that, and it can be a real pain if you don’t really want it.)
I’ll take a look to confirm if this is the case, and have a think about how you might avoid the problem, and if there is anything the Embedder can do about it. I’ll post another reply here later.
Mike
I just finished playing with a couple of examples, and I can confirm that the problem is WordPress’s automatic formatting functions that add extra line-spacing and paragraphs when generating the output.
The formatting is already done before your embed user function is called (and before Embedder sees it too) so there isn’t really anything the plugin can do to stop it from happening. (And in most cases, it’s what people expect to happen, so automatically removing the formatting would not be a good thing anyway.)
The formatting rules following by the “wpautop” function that does all this is when it sees a single line break it inserts a <br /> tag, and when it sees a double line break, it adds the </p><p> tags. In the WordPress post editor, in Visual Mode, hitting the Enter key gives you a double line break (i.e. a new paragraph) and hitting Shift-Enter gives you a single line break. In HTML Mode if you hit the Enter key once you get a line break, hit it twice you get a new paragraph.
Now, there are a couple of things you can do about thi. The first one is the easiest, but does mess up your formatting a little. Instead of:
[my-embed]
text text text
text text text
[/my-embed]
You could do:
[my-embed]text text text
text text text[/my-embed]
(assuming you want that line break in the middle of the “text” content.)
If that’s not good enough, then you have to strip the tags you don’t want from the output between the tags in your embed function. There are a different ways to do this depending on what you want:
If you want to strip all the formatting from the content you can do this:
function my_em($name, $value, $attrs, $content) {
$content = str_replace(array('<br />', '<p>', '</p>'), array('', '', ''), $content);
return $content; // Note you have to return the modified content for this to work.
}
If you only want to strip the first “p” or “br” and the last “p” or “br” you have to use a regular expression:
function my_em($name, $value, $attrs, $content) {
$content = preg_replace('/^s*<brs*/>|^s*</p>|<brs*/>s*$|<p>s*$/', '', $content);
return $content; // Note you have to return the modified content for this to work.
}
(Regular expressions are complicated mess, but I have tested the one above and it does work. It looks for “br” and “p” tags only at the beginning (^) or end ($) of the content and replaces them with an empty string, and leave all the other line breaks and paragraphs alone.)
Please note, that if your embed has a value (template), like this:
<b>%content%</b>
You will have to insert the stripped content (in the $content parameter) into the template yourself and return the whole thing from your function, otherwise the embed will just take the original content. You can do that like this:
return str_replace('%content%', $content, $value);
That’s the best I can offer. Your function has to do the work to strip out those extra formatting tags, I’m afraid. The only other alternative would be to turn off “wpautop” altogether (just Google for “wpautop” to see how you can do that) but you would then have to add all the line breaks and paragraphs manually, which I doubt is what you want.
Let me know how you get on.
Mike
Hi Make, you mentioned earlier that one shortcode can be nested in the another if only the plugin “call do_shortcode on the contents between their tags”. Can you tell me how to modify current version of embedder so it can be able to parse shortcode in the value? I really want that. Thanks in advance.
Sure — but if you can you give me an example of what you want to do, that would help.
Do you want to do this:
(1)
[shortcode] Some text [embed] More text [/shortcode]
Or this:
(2)
[embed] Some text [shortcode] More text [/embed]
I think, from you previous questions, it is (1) — you want to use Embedder embeds inside a shortcode provided by another plugin, correct?
If that is the case, is the text (a) between the tags ([shortcode]…[/shortcode]) in the post text (i.e. did you type it in with the editor) or is it (b) generated by another plugin (i.e. automatically inserted by the plugin)?
If it is (a) then you are in luck. The new parser I will be adding to Embedder in the next version will process all the embed tags before any other shortcodes are processes, which means that embeds nested inside other shortcodes will work automatically.
If it is (b), and the other shortcode is inserting an embed into the text, that will not work at the moment — but there is probably a way to make it work, by delaying the processing of the embeds until *after* the shortcodes are processed, which could be an option.
So if you can give me an example of exactly what you are trying to do, that would help me figure out if the new parser will help you or not.
Mike
Hi, what I want is more like (b). For example, I define a new embedder shortcode [a], and in the value field of [a] I have “some text and some text”. is provided by another plugin and is a form. So by simply putting [a] in my post I want this output “some text (a form) and some text”.
I dont know if it’s possible but thanks anyway.
why [b] is filtered out in my previous comment? I will try another way:
For example, I define a new embedder shortcode [a], and in the value field of [a] I have “some text [b] and some text”. [b] is provided by another plugin and is a form. So by simply putting [a] in my post I want this output “some text (a form) and some text”.
Okay — thanks Phil, I understand.
Try this:
Your embed is [xyz] and the other plugin’s embed is [form].
In the value for [xyz] put:
“Some text %content% some more text”
(In other words, don’t put [form] in the value, put the attribute %content% there instead.)
Then in your post, you can put [xyz] [form] [/xyz] (but remember to leave a space between the shortcodes or it won’t work!) and then when [xyz] is processed, the nested [form] shortcode will be processed and you will get the form.
That might be a little too messy for you, so if you just want to have one [xyz] tag and keep the [form] in the embed value, you can add a small user function instead.
You have to add the function to WordPress — the best place is usually in the functions.php file in your theme, but another plugin will also do. (And remember to add the user function name into the settings of your embed.)
Or, you can wait for the next version of the plugin (sometime in the next two weeks) and because the new parser will process embeds *before* shortcodes, it should work automatically. 🙂
Thanks Mike, both methods work and I like the second one.:)
hi,
thanks for your explanation!
right now i managed the problem in the way that i put the following code into the content.
[my-special-div]
text text text
text text text
[end-div]
this works in my case quite well. when i encounter the need of wrapping content into a start and end tag i will try your solution. i just read about the new parser from version 1.3 – does it change anything to this odd behaviour from wpautop?
thanks for your help!
I just installed this plugin (v 1.31) for the first time today. No matter what I add in the fields, I get the following error when I click on the “Add Embed” button:
Fatal error: Cannot pass parameter 1 by reference in /wordpress/wp-content/plugins/embedder/emb-admin.php on line 214
WordPress version : 3.02
Linux ISP
Apache 1.3.41
PHP 5.2.5
MySQL 5.0.81
I get the same error whether I use New Embedder Parser or not.
same here … i just tried to add an embed with a new install of wp and it only returns a blank page. and it’s not related to wordpress 3.0.3 …
I also tried to disable ALL the plugins except Embedder. No luck. Same symptoms.
Okay — sorry to hear that you are having problems. I’ll look into it.
Well, I’m not entirely sure why the line 214 was causing a problem for some people—I’m pretty sure I tested it with PHP4 and PHP5—ah well, it happens, I guess.
I removed the issue altogether by removing what was a little bit of a lazy hack in the first place, with an even lazier (but much safer) hack :).
So if you happen to read this note, stephane and Martin, if you could try version 1.3.2 and let me know if it solves your problems, I would be very grateful!
Thanks,
Mike
That did it. Thanks Mike. I haven’t tried anything else yet but with 1.3.2 I can now add a new embed without getting an error. Thanks again!
Thanks for letting me know, staphane. 🙂
Hey Mike,
Just wanted to let you know I put the new 1.3.2. plugin to use this morning and it works flawlessly. I used the new parser mode, and 5 attributes to embed Scribd docs in Flash. Your plugin is a life saver!
One quick minor note: on your website it says that “When you use attributes with global embeds, the plugin identifies the attributes you have used in an embeds and displays them in attributes column in the table.” It seems only the first attribute is shown, which is fine, but it would be nice to see them all. If not in the table, maybe in the “Edit Embed” page?
Thanks.
Hi Stephane, glad you’re enjoying the plugin, and thanks for the feedback. It’s nice to know things are working well.
Yeah, I know about the attributes in the table — I actually print them all out, but because I don’t allow enough space in the column in the table, if there’s more than one or two, the rest overflow the column and are not displayed. I’ve been meaning to tweak the column widths to fix it, so I’ll probably do it in the next version. (I probably shouldn’t put out any more updates for a few days, though, having had three in three days 🙂 )
No big deal really. The main thing is it’s stable and works great. 🙂
I really like Embedder because it makes coding and creating pages a lot easier, thanks!
However I think I encountered a problem: When I use Embedder and another plugin called Hackadelic Sliding Notes – btw its syntax goes like this: [slider title=”push me”]content[/slider] – is activated the “content” isn’t displayed anymore so basically the sliding plugin stops working. Without Embedder everything is fine, so I thought this might be a bug?
Infos: I’m using WP 3.0.3 and your is parsing method enabled…
Thanks for the information, Rumli. It does sound as though the two plugins are not behaving well together. I’ll take a look when I get the chance, later, to see if there is anything I can change in the Embedder to resolve the issue.
Mike
Thank you Mike, it would be great if you could find a solution for this. I really need Embedder and the sliding plugin. 😉
Well, it’s never simple, is it? I installed the sliding plugin, and tested out with the following:
where “col” is an embed which sets the color of the text (without the space after the open bracket). You can see from this test page:
http://test.englishmike.net/wordpress/2010/11/14/embedder-v0-3-posted/
that it’s working okay (the slider expands, and the colors are set to red (outside the slider tags) and green (inside), so in principle, I think the two plugins should work together fine (if you use the new parser — the old parser does not see the embed inside the slider tag, but that’s probably a problem with the Slider Plugin, not Embedder :-).
Soo… I will probably need more information if I have any chance of resolving your problem.
— Is the content missing even if you don’t have any embeds on the page?
— I assume you do not have an embed called “slider” — that would certainly cause problems!
— Have you looked at the source code of the generated page (Ctrl-U on Firefox) to see if the content of the sliders are completely missing, or just not showing up?
I’m not quite sure what’s going on, honestly. I looked at the slider code, and nothing jumped out at me as being a problem — he is just using a standard shortcode, which should be fine.
If you can give me an example of a slider that is having the problem (or perhaps a link to a page with one on it), that might help too.
Mike
Unfortunately I can’t give you a test link because my page isn’t officially online yet (currently I’m just switching my old index.php with the wp one for a few minutes ;-)).
But I can try to give you as much information as possible: Embedder and “Slider” are used on the same page but not mixed as in your example. I use local embeds (for images in a table) and a global one. The slider is inside a table cell like this: “[slider title=””][/slider]” and no content is added to the page – I think that’s the problem because I can see Slider to start moving (trying to show something). The following is simply missing at the very bottom of the page:
CONTENT
I disabled ever other plugin (except qTranslate) and the problem persists. What else can I say…I’m using jQ as my theme with jQuery from google (using deregister, register, enqueue in functions.php (took me pretty long to find out how I could stop wp and jQ from loading the included script but it seems to work just fine now)).
I hope this helps.
Regards,
Rumli
Sorry, the html code was stripped out. So lets try again with the code-tag.
In the table it looks like:
[slider title=""][/slider]
And this is missing with Embedder enabled:
CONTENT
I don’t think JQuery is a problem, since Embedder doesn’t use JQuery (except in the admin pages), and being in an HTML table shouldn’t be a problem either. I still don’t see what the problem could be.
All I can suggest now is for you to send me and email with the following attachments:
— the source of a page with the bug (i.e. edit the page with the HTML editor in WordPress and cut and paste it into a file and attach that file to the email.)
— the output of that page in the browser (i.e. save the page in the browser — HTML only, don’t need the images — and also send it to me as an attachment.
Then I can see what how the page is being transformed.
Send these files to mike@moztools.com and I’ll take a look at them, though I will be quite busy between now and Christmas, so I can’t promise I will get to them quickly.
In my e-mail I said that I will check if uncommenting my changes to Slider will change anything. Well, I just tested it and didn’t help. In the post above I also said that I disabled all plugins but qTranslate – just did it as well and didn’t help either…I hope you find a quick solution.
Anyway, I think I just found another small “bug”: It is possible to use attributes in the “Wrap Embed” option fields but those won’t be displayed in the overview page.
Regards
Thanks, I have the email — and yes, the plugin doesn’t look in the wrapped fields for attributes at the moment. Noted.
Okay, figured out the problem — I should have noticed this before, it’s not really a bug in either plugin, it’s just that we’re playing around with the same WordPress filter — ‘the_content’ — which is why Embedder is causing a problem for Slider:
In hackadelic-sliding-notes/hackadelic-sliders.php you have this:
But in embedder/emb-parser.php you have this:
The numbers are the order in which the filters are called. The shortcode filter — the one that does the main substitution for Slider, is normally priority 11, and Slider expects it to have been called before its “postProcessContent” filter is called, at priority 12. But, as you can see, Embedder moves the shortcode filter to priority 15, which messes things up.
I have my reasons for doing this (but it would take too long to explain), and when I did it I remember wondering if it might cause problems down the road (but of course I forgot about it). WordPress doesn’t help because most of the existing filters using “the_content” are clustered tightly around priority 10 (and you cannot guarantee the ordering with filters with the same priority) so plugins have no room to insert their own filters between existing ones, which is why I move the “do_shortcode filter”.
Anyway, to fix this problem, all you have to do is adjust the priorities again. I suggest, since you have already modified Slider, and you will probably want the next version of Embedder when it comes out :-), that you change Slider rather than Embedder. (But it’s up to you, of course).
In hackadelic-sliding-notes/hackadelic-sliders.php just change this line:
to this:
and it should all work again for you. (BTW: You do not need to change the “widget_text” line, even if you use sliders in widgets.)
I may have to add an option to Embedder to allow users to change the order in which things are done, to help prevent this type of problem, but I will have to think about how best to do that.
Thanks for feedback. And I hope the workaround works for you. Please let me know how you get on.
Mike
It works! Thank you very much Mike, I really appreciate your help.
If you have a possibility to receive donations, I would like to give you some of my spare dollars… 🙂
Best regards
Thanks, Rumli. I’m glad it works. I might have to add something like a compatibility mode option, one where Embedder doesn’t mess with the priority of the filters.
And thank you for your kind offer of a donation. I haven’t gotten anything set up yet, so don’t worry about it right now. I will set something up over the next two or three weeks, and if you happen to remember to donate after that, that’s great otherwise, no worries.
Mike
I’m looking forward to your new releases of this excellent plugin and I really think you deserve more attention on wordpress because I tested some others (more popular ones) and think that yours is the best!
Yes, a compatible option is probably needed but for now a small note on the installations notes or whatever would be enough I think.
You’re too kind! It does take time to build a reputation, but I believe the better plugins usually get noticed in the end – the number of daily downloads usually picks up after each release as more and more functionality is added.
I was hoping to get the next version out before Christmas — one that adds a metabox to the edit post/page pages containing buttons for inserting your embeds into the editor, but with all the differences between the various browsers, it’s proved to be more difficult to get right than I thought. It should be a nice addition when it’s done.
I’ve also been working on a plugin to turn any comment thread into a forum (Instant Forums — you’re looking at it now, it case you didn’t notice! 🙂 ) I suspect that one will take off faster than Embedder, because it’s cool feature you can instantly enhance your blog with (hence the name). It’s especially useful for low traffic, single issue support forums like this one, which is why I created it in the first place. I’ve tried supporting code before on regular blog comment threads and it becomes a real pain after a while.
Mike
This is a great plug-in and enables me to allow the client to add formatting without having to use the html view, which causes panic.
It works great if I don’t check the “Use the embedded parser” option. But if I enable the parser, I get the following error when trying to view the page:
Fatal error: ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers in C:xampphtdocswordpresswp-contentpluginsembeddernbbc-1.4.5nbbc.php on line 1442
Any suggestions?
Hi! I want to know if a certain attribute is present in a tag, and if it is, do something, if not, do something else.
ie: [tag attr1=”hello”]
if(attr1 is present)
do something
else
do something else
Is this possible? how?
thanks!
How about just adding a flag to the embed definition:
[x] check this if your embed contains other shortcodes that need to be processed after this embed is expanded
If that option is checked, then call do_shortcode() on the resulting embed string directly.
You could also do it automatically by checking to see if the replacement text contains “[[a-z1-9+-]+]”
These both localize this to your plugin, rather than requiring a function to be added to the theme.
Hello, I am trying to add a link in my sidebar widget to my “Helpful Information” page. Will embedder allow me to do this and if so how? I want to create a embed named [click] here for more information, that when clicked on takes the user to my Helpful Information page.
Thanks, Dave
I use a WP blog including 2 plugins for my posts. The first one is a picture viewer and the second one is a tabs plugin for a bettter look of my posts. But when I try to use the plugin to embed my posts for other blogs who don’t have my picture viewer and my tabs plugins, the embedder doesn’t detect them and the posts have a very bad look. Is there a solution for this?
When using this great plugin to make it easier for volunteers in my church to add HTML to podacst posts, we’ve hit a challenge when using the new embedder parser. If this is enabled and somebody comments on the post, the comment is submitted successfully, but the user is presented with an error (note: paths edited for security):
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-comments-post.php on line 95
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-comments-post.php on line 96
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-comments-post.php on line 97
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php:1106) in wp-includes/pluggable.php on line 897
Using WP 3.1.2 with Genesis Theme Framework (v1.6).
Note that the issue is fixed by simply disabling the new parser, although I’m not sure this is the best way forward…
Kind regards,
-John.
The Embedder plugin is great, but only Admins can access the admin page. I have a bunch of Editors that need to use Embedder, but they cannot create new embeds or access old ones.
Any advice?
Tks!
Hi Mike,
It’s me again. A half year has passed now and I just want to let you know that I’m still succesfully using your great plugin. Please don’t stop creating new features… Embedder is still loved by thousands! 🙂
Regards,
Rumli
Hi! Awesome plugin. Gets the work done. Although it seams not to embed php properly. I’m getting the php code displayed instead of the function. 🙂 After what I understand that the arguments is processed after the php code is processed, so how wouold I go about displaying a md5 checksum in an embed?
Best regards
Johan Brodd
Hi Johan — the Embedder plugin doesn’t support embedding of PHP directly. What you can do though is call a PHP function you create when the embed is found. The details on how to do that are on this web page:
http://moztools.com/embedder-plugin/advanced-features/
I can’t seem to find where to make local embeds the menu that apears on the tutorial doesn’t appear con my new post
Hi,
I turned on the embedded parser without any other changes, so I could see what it would do, and this is what I get:
Fatal error: ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers in /home/content/92/8274492/html/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1442
It seems this only occurs on single post pages and stand-alone pages and not on the home page or a category page.
Arnoud
Sorry, forgot to mention: Embedder 1.3.2 on WordPress 3.2.1.
Seems like you dropped development on the Embedder plugin 🙁
No updates and posts in the support forum for a long time…
Well, if you once restart further development, please keep in mind that the new embedder parser won’t call user functions anymore. Tried everything as suggested but the defined user functions only seem to work with the old parser…
I love this plugin… it could be a real time saver!
However, the plugin seems to fail in my WordPress RSS feed. It’s neither shown or expanded.
Is there any way to get the macro expanded in RSS feeds as well?
Thank you.
Hi. I’m just trying out the Embedder plugin. It looks like a great plugin, but I can’t get it to work as expected.
1) Checking the “Use the new Embedder parser” seems to do nothing. It doesn’t stay checked (there is no ‘save’ settings button). Each time I return to the Manage Embeds screen it is unchecked again.
2) Checking the “Wrap the HTML in a div or span” doesn’t allow me a place to select div or span, and doesn’t offer a place to add classes. Then in the output the result is:
my content
Rather than
3) I created an Embed named check_out_link with the content shown below using a shortcode from another plugin inside an Embed (using j-shortcodes to create a button), along with some PHP for another conditional link:
[jbutton size=”medium” color=”blue” rounded=”yes” link=”/myaccount/”]Your Account[/jbutton]
cart->cart_contents)>0) :?>
<a href="cart->get_checkout_url()?>” title=””>
I’m sticking the Embed shortcode [check_out_link] inside an Advanced Text Widget which supports shortcodes from many other plugins.
The output is that the actual j-shortcodes shortcode is printing to the screen rather than rendering. In addition, it is bracketted by “” quotes in the output (renders that way with or without the wrap applied):
”
[jbutton size=”medium” color=”blue” rounded=”yes” link=”/myaccount/”]Your Account[/jbutton]
”
Thanks for your help.
Jeff
My code got stripped, so I’ll add it back here with some extra spaces:
2) my content
Rather than
3)
[jbutton size=”medium” color=”blue” rounded=”yes” link=”/myaccount/”]Your Account[/jbutton]
then some php code
output:
”
[jbutton size=”medium” color=”blue” rounded=”yes” link=”/myaccount/”]Your Account[/jbutton]
”
code still got stripped…here’s the only one you probably won’t figure out without showing it again:
2) lessthansign span class style greaterthansign my content lessthansign /span greaterthansign
rather than:
lessthansign span class=”classname” greaterthansign my content lessthansign /span greaterthansign
Hi there,
is it possible to create global embeds without utilizing the admin interface/the underlying database? Having to provide a large blog network with the same shortcodes manually managing each one of them becomes impractical, when you also wanna add addtional shortcodes from time to time and have them in sync across all blogs.
Using an additional plugin or a parent themes function.php feels like a solution. Is it possible to do this using Embedder, as it is with the native WP shortcodes? Thanks in advance for any help!
I just embedded the html for a flash presentation into my site, but it does not appear in the page. What is really weird is that when scrolling down the page, I can see a narrow strip of the graphic that I want to show up in there. As someone without enough knowledge of flash or javascripts to find the problem myself, I was wondering if anyone has seen this before of may offer a solution?
Here is the link to the page: http://onesolarroof.com/1-test-mass-cec-interactive-map/?preview=true
And here is the location of the map I’m trying to imbed: http://www.masscec.com/index.cfm/page/Massachusetts-Clean-Energy-Installations/cdid/12048/pid/11163 (MassCEC is a public org that I work with, I have permission to use the map)
I’ve tried using different sections of the HTML from the source page, so currently it has a lot of ugly broken image links etc that I can remove later. For now I’m just trying to get the map.
Any help would be very much appreciated. I’m still learning, and unfortunately this one has me stumped.
Thanks!
Joe B
Embedder works realy nice. I managed to do what I needed.
But there is one issue.
I want to post some instructions for users how to use embed tags, but I cannot because each tiem I use tag it gets parsed.
I had to use & #91 ; and & #93 ; instead of brackets to make tags displayed and not parsed.
It would be nice to have option to marks block of text where Embedder will not parse contents.
I had strange problem: each time user posts comment he receives error caused by Embedder:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/pedja/public_html/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106
I noticed this happens only for blog visitors. If logged in user posts comment, there is no error.
Fix was simple, I checked if parameter is array before using it so I avoided error.
Here is code fix
function AddRules($rules) {
if (is_array ($rules)) {
$this->tag_rules = array_merge($this->tag_rules, $rules);
}
}
I guess you would like to investigate this further and fix in new release.
I’m experiencing the following PHP Warnings:
Regards
Will Chapman
Hi, I’m having an issue with Embedder breaking other ads and JS.
All of a sudden, I noticed that my 160×600 sidebar ad (media.net,) my 468×60 ad in the header (media.net) weren’t being displayed and the 300×250 in the sidebar (Avantlink) was being pushed down to the very bottom left of the page. This is all when on a single post (on single pages and homepage it’s fine.) The embedded in-content 468×60 and 300×250 ads for Adsense were working, but not for media.net (split testing through oiopublisher) and the script for Infolinks wasn’t running on single posts either.
When I disable Embedder, all works fine (except of course the embedded ads.)
What could possibly be causing this?
Thank you for any help!
Oh, and I imagine giving the URL would be useful 🙂 it’s http://www.automoblog.net