Wordpress: plugin issue..

CitizenSmif

New member
Jan 26, 2009
756
9
0
Scotland
WF,

I'm still not quite sure what exactly about this isn't working..

I'm using 'Wp_UCanHide' which is a simple plugin that is supposed to hide content wrapped in [hide][/hide] tags to unregistered users. I'm, using this at the same time as a job board plugin which doesn't treat the job entries the same as normal posts it seems.

The hide plugin works perfectly in normal posts but when trying to edit the job board plugin manually to include the [hide] tags in part of its output.

Originally the output code was
[high]
<?php apply_filters('the_content', $job['how_to_apply']) ?>
[/high]

I've tried this (and a few others combinations which I think *should* work)
[high]
<?php $text = '[hide]' . apply_filters('the_content', $job['how_to_apply']) . '[/hide]' ?>
<?php apply_filters('WP_uCanHide', $text) ?>
[/high]

Now it must be passing the text through the function as its still displaying the 'How to apply' section, but it still displays when no ones logged in (yes, I've logged out of admin panel and theres no cache).

The hide code checks if user is logged in by using
[high]
if ($user_ID == '')
[/high]

Does anyone have any ideas on how to fix this?
 


As for your problem... I think the order of plugin execution is the culprit. The job board plugin does its thing before the Ucanhide plugin.

You could try renaming the folder name of the ucanhide plugin to 0canhide (the number zero), or something else that will place it before "j" as in "job board" in the alphabet. If the ucanhide plugin is a single file (as opposed to a plugin folder), you could also just move that file directly into the wp-content/plugins directory, without having it in a folder. WP executes plugins in folders first and single files after.

All provided that this is the reason for this in the first place. WP unfortunately doesn't offer any way to customize the order of plugin execution at runtime.

Be sure to let us know if that was it, I have no idea if this will work but I think it's worth a try.
 
Thanks Bob. The syntax highlighting has been around for a few months, check the sticky.

It turns out the issue was with me being a vagina.

I was slightly concerned that all of the variations of code I tried hadn't give me an error even once. I'd searched through the plugin file to try and find if this was referenced anywhere else but had no luck. There's also a 'template' file included which holds the same functions as the main file just with '_template' added to it, I assumed this was only for if I wanted to use the functions elsewhere in the site without directly editing the core file.. I was wrong, the same code appears in that file. I made the same edit in the template file and now it all works.

The joys of coding.