Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using Jquery Hover Footnotes plugin that allows adding footnotes and dynamically displays them on hover-over.

In other words, I use {{FOOTNOTE_NUMBER}}, Then I embrace the actual footnote text with double brackets [[FOOTNOTE_NUMBER]] Footnote text [[FOOTNOTE_NUMBER]]. the plugin will find these "shortcodes" and auto place a box onhover on a footnote. For more information about this plugin thanks to visit http://wordpress.org/extend/plugins/jquery-hover-footnotes/

An example here: http://restoredisrael.org/blog/961/footnote-plugin-test-page/

I am in addition using custom fields , and I get their content by using:

echo get_post_meta($post_id, $key, $single);

The problem is that this plugin is only applied to the content (returned by the_content()). While looking at the plugin code, I found:

add_filter('the_content', 'jqFootnotes', 1, 1);

So I tried adding this filter also for the meta values:

add_filter('get_post_meta', 'jqFootnotes', 1, 1);
add_filter('key_name', 'jqFootnotes', 1, 1); 

BUT IN VAIN.

What should I do so that the plugin will be applied also on footnotes inside my custom fields?

share|improve this question
    
That plugin has not been updated in over two years. You should use with caution. How does that plugin work? Ho do you add footnotes to content? –  s_ha_dum Feb 24 '13 at 14:54
    
"More information" is all the thanks I need. :) –  s_ha_dum Feb 24 '13 at 15:15
add comment

1 Answer 1

up vote 1 down vote accepted

I think that what you need to do is find where your custom meta data is displayed and do this:

echo jqFootnotes(get_post_meta($post_id, $key, $single));

That will run the jqFootnotes filter on your post meta, and I think that will do what you need (assuming that $post_id, $key, and $single are set appropriately)..

Side note: just because there is a the_content() function and a the_content filter doesn't mean that you can use any function name as a filter. Most functions do not have a matching filter.

For reference: http://codex.wordpress.org/Function_Reference/apply_filters

share|improve this answer
    
I tried this solution but it is not working even if it is very logical. Should I perhaps add the filter somewhere before applying it? Anyway thank you for your time and for the interesting side note. –  whiteletters and blankspaces Feb 24 '13 at 16:07
    
See my edit. Skip any attempt at using filters. –  s_ha_dum Feb 24 '13 at 16:19
    
it is working, real sincere thanks. :-). I hope I can me too provide with such good quality help in this community –  whiteletters and blankspaces Feb 24 '13 at 16:22
    
now I have enought repu to vote :-) –  whiteletters and blankspaces Apr 2 '13 at 3:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.