Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Resolve permission error with Multi-Category Dropdown WordPress

  • SOLVED

Recently [[LINK href="http://wpquestions.com/user/profile/id/4312"]]Jurre Hanema[[/LINK]] created a plugin for me on this [[LINK href="http://wpquestions.com/question/show/id/2799"]]question[[/LINK]]. I've since found that it only works when a user is logged in. When not logged in it shows the message<blockquote>no categories found</blockquote> This is caused by the plugin "[[LINK href="http://wordpress.org/extend/plugins/role-scoper/"]]Role Scoper[[/LINK]]"

I'm itchy to get this live for my customers, any help would be appreciated. You can find information for the download and implementation in the thread below Jurre Hanema.

Answers (4)

2011-08-11

Hai Bui answers:

I modified the plugin by Jurre Hanema (fixed the conflict with "Role Scoper" by removing ajax function and use javascript only)
download it here http://bit.ly/nAy5pk


Zach Shallbetter comments:

Resolved the categories appearing but when selecting the category it redirects back to the main page instead of the category page.


Hai Bui comments:

Where does the form submit to? Can you post the whole page code?


Hai Bui comments:

hang on...


Zach Shallbetter comments:

Originally we were using
<form action="http://www.openeye.net/" method="get">
<?php
if(function_exists('mcd_print_dropdowns')) mcd_print_dropdowns();
?>
</form>


Hai Bui comments:

I fixed it, please download it again http://bit.ly/nAy5pk


Zach Shallbetter comments:

Ugh still redirecting, I wonder if something else is occurring with Role Scoper.


Hai Bui comments:

hmm... can you send me the url? either here or to [email protected]

2011-08-09

Jerson Baguio answers:

i modified the plugin by Jurre Hanema download it here

[[LINK href="http://bit.ly/qzOSnI"]][[/LINK]]

or

http://bit.ly/qzOSnI


Zach Shallbetter comments:

Doesn't seem to work at all now even when Role Scoper is disabled.

2011-08-09

Romel Apuya answers:

I bet the ajax isnt localized.

change your function mcd_print_scripts to this one :

function mcd_print_scripts()
{
?>
<script type="text/javascript">var mcd_ajax_url = "<?php wp_localize_script('mcd-script_json_config', 'mcd-script_config', array('ajaxurl' => admin_url('admin-ajax.php'),)); ?>";
</script>
<style type="text/css">#mcd_child { display: none; }</style>
<?php
}
?>


if not working you can have a better reference in [[LINK href="http://wordpress.stackexchange.com/questions/3610/how-to-manage-ajax-calls-and-json-in-wordpress"]]here [[/LINK]]


Zach Shallbetter comments:

That's exactly what I thought first but it didn't seem to resolve the issue. In fact, when I change mcd_print_scripts it no longer shows the second drop-down.


Romel Apuya comments:

how about changing the two functions.

function mcd_enqueue_scripts()
{
wp_enqueue_script('mcd-script', plugins_url('multcatdropdown/mcd.js'), array('jquery'));
wp_localize_script('mcd-script', 'mcd-script_config', array('ajaxurl' => admin_url('admin-ajax.php'),));
}


function mcd_print_scripts()
{
?>
<style type="text/css">#mcd_child { display: none; }</style>
<?php
}

?>


Romel Apuya comments:

and changing

add_action('wp_enqueue_scripts', 'mcd_enqueue_scripts');
to

add_action('wp_head', 'mcd_enqueue_scripts');


Zach Shallbetter comments:

Still nothing it no longer loads the second category list when logged in or out.


Romel Apuya comments:

can you post the link to your website?


Zach Shallbetter comments:

it's [[LINK href="http://www.openeye.net"]]http://www.openeye.net [[/LINK]] The site that I'm applying this plugin to is in development. If you send me a direct message with your information I can get you access.

2011-08-10

ej_emman answers:

is this just happen after you activate the role plugin?


Zach Shallbetter comments:

Yeah, Role Scoper is embedded pretty heavily into the site. When I disable it I'm able to use the multi-category plugin without logging in. Otherwise I need to be logged in.


ej_emman comments:

have you try to unrestrict the post reader on role plugin restriction page?


ej_emman comments:

http://wordpress.org/extend/plugins/role-scoper/screenshots/


Zach Shallbetter comments:

Which page is that? I'm not seeing it here.


ej_emman comments:

just follow the screenshot on my attachment.....