Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Blog Post Linking plugin add link text before the beginning of the page
Avatar
Bruce Brown
Member
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 9:00 pm

I JUST EDITED MY QUESTION:

Do happen to know what the 'callback' is?

(trying to relay between my son and the forum, and I don't even know the meanings of the questions I'm asking.

Sorry... embarassed

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 9:13 pm

yes its generic and needs to be the name of the filter you want to remove?  not entirely sure what you are trying to do... but perhaps 'the_content'...

Avatar
Bruce Brown
Member
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 9:20 pm

Oops, I was too slow with my edit. Please see above...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 9:49 pm

the callback is the routine or function you are calling when the filter is run...  I cannot predict what that is as it will be done by your theme...

so back to my point, have you looked or usage of the_content within an apply_fillters() function call within the theme?

Avatar
Bruce Brown
Member
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 10:45 pm

Thanks for the replies. I am the guy that is actually trying to fix the problem (Bruce's son).

I have been trying to figure out how to formulate a remove_filter() call to solve the problem. I thought I had a pretty good understanding of how to do that but you've stumped me with "the callback is the routine or function you are calling when the filter is run…  I cannot predict what that is as it will be done by your theme…"  I was operating under the assumption that the callback was determined by the plugin author, not the theme.

I have tried several variations of the following: remove_filter('the_content', 'foo', 20) "foo" being a number of filters found in the sp-linking-plugin.php file. But I am blindley guessing as to what the correct foo might be.

And now you tell me that foo is determined by my theme? Hmmmm.....

You're not entirely sure what we are trying to do? We are trying to fix the hinky forum/blog integration link found here:

http://www.commonsensereview.c.....test-post/

The link is being created twice (which is why Swordfish's initial response (and my gut feeling)) seemed most likely, but I have yet to find the duplicated the_content call that may be the problem.

Perhaps it's not a the_content that is the issue but some other filter call, or maybe I just haven't looked in all the right places yet.

And this sentence makes no sense to me: "have you looked or usage of the_content within an apply_fillters() function call within the theme?" Sorry.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 10:54 pm

yeah, I know you want to fix your issue... I was more referring to what you were doing as to removing a filter...

I am only guess that you want to remove the potential second use of the filter the_content that Andy mentioned...  and no, if you want to add a filter usage, it would be in the theme, not the plugin...  we use the filter, but then it calls our routine...  if you are trying to do something different, then please explain...

What I was asking you to do is to search through the wp theme you are using for any apply_filters() function calls and see if there were any for the filter the_content...  if so, you would see what the callback they were using was...

but I am also wondering if Any was really saying that your sp theme was actually calling the wp function the_content() twice vs the filter...  in that case, you would want to search your theme for that function call the_content() and see where its done...  since you did not find a second one, I was wonder if perhaps it was done via a filter vs a direct call...

for example, we do:

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

so our callback is sp_render_forum...  so look for something similar in your wp theme and lets see if your theme is keying and outputting data based on that filter since you cannot find multiple calls to the_content()...

Avatar
Bruce Brown
Member
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 11:14 pm

Sorry, I guess I'm thick headed, tired and grumpy. I finally get what you mean about the the_content being called from a filter, and will look at that closer.

What is the function that creates the "Join the Forum discussion on this Topic". Can't I just run a remove_filter on that, then place that function on the page where I want it?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 11:20 pm

these would be the two you are looking for

    add_filter('the_content',                 'sp_linking_show_blog_link');
    add_filter('the excerpt',                 'sp_linking_show_blog_link');

do you have a link to this theme? we might be able to look at it and see what is up...

and dont worry about asking questions... we are here to help... and frankly, Andy wrote the blog linking stuff, so he knows it better than I! kiss

Avatar
Bruce Brown
Member
Free Members
sp_UserOfflineSmall Offline
May 25, 2012 - 11:37 pm

Well, I did a more thorough search through the theme's files. I did not find any apply_filters (aside from one in the functions files). And a few of the files do have two the_content calls, but they are nested in "if" statements. I wonder....

And yes, I do have a link to the theme as we are using it here ya go: http://www.commonsensereview.c.....lypost.zip

 

And I think I'll call it a night. Thanks for the help. Sorry if my crankiness came though a bit too much.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 26, 2012 - 2:23 am

Morning Bruce and Son of Bruce

Rather than mess with your theme filters I would suggest using a standard template tag in the theme template(s). This will ensure that it only gets run the once. Then you can turn off the option in the forum admin. The downside of course is that you are making customisation to your WP theme template but easier to deal with probably than messing with filters.

If you want to take this route the template tag call is:

spBlogTopicLink($postid, $show_img);

You need to pass the $post id. The standard for this when placed in the loop is the global $post->ID so I would try that and hopefully your theme does support it.

The second parameter is just a true/false on whether you want the little icon to show alongside the label text. It defaults to true.

That template tag performs the echo so you do not need to echo it.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625