housebg
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Comment Moderation Issue – need helpOkay, I solved it – so I’m going to document in case anyone else has this problem.
There is a pre_comment_approved filter, so I used that to add a function that forces every comment to be moderated, including ones that the author of a post makes on their own post.
add_filter('pre_comment_approved', 'xko_pre_comment_approved', null, 2); function xko_pre_comment_approved($approved, $commentdata) { $approved = 0; return $approved; }
Forum: Fixing WordPress
In reply to: Comment Moderation Issue – need helpI’m getting closer, but still stumped. If the logged in contributor comments on a post that they are NOT the author of, the comment goes into moderation like it should.
But if they comment on their own post – it’s automatically approved.
I there a filter or function I can use to stop that behavior and make their comments be moderated, even if they are author of the post?
Forum: Fixing WordPress
In reply to: Comment Moderation Issue – need helpAppreciate the link, but I was already over there double-checking role capabilities. I understand that customization can cause problems – what I’m looking for here is an explanation of what circumstances can case the “ALWAYS” to be overridden.
If someone can tell me when always gets bypassed, then I can start going through code and various plugins to see what’s mucky up the process. But the codex says this is ALWAYS, and the code in comment.php is pretty specific to check for this flag first and then break out.
It would seem, therefore, that every comment would be held for moderation – but it’s not. So I need to understand when this always can be overrulled – what kinds of circumstances, etc. Otherwise, I’m shooting in the dark here without any kind of idea where the problem could be.
Make sense?
Forum: Fixing WordPress
In reply to: Comment Moderation Issue – need helpActually, it’s not resolved at all – sorry if I gave that impression.
Here’s what we have…
1 Administrator, which is me as the developer
1 Editor, which is the site owner
up to 60 Contributors. These are the business owners that have one of these listings on the site.I use a combination of Adminimize and custom code functions to limit who has access to what.
I had this working before, and when one of the business owners logged in and made a comment, it was being moderated. I’m not sure what changed, and unsure how it could change from my reading. The “must always approve” is where I’m stumbling…
Is it “the administrator must always approved – unless it’s one of these conditions that’s built into WordPress that you may not know about” ??
All joking aside – always means always to me – so why are these comments being sent through instead of held in moderation? Again, it’s logged in users – not guests. Does logging in bypass the “adminstrator must always approve”? If it does, how do I change this functionality? Is there a filter I can use to make always = ALWAYS ?
Forum: Fixing WordPress
In reply to: Comment Moderation Issue – need helpThanks Krishna for trying to help. These users as Contributors as their Role. We set them as the author on the post in the admin, but they are still contributors.
Mostly, I’m looking to understand why the “An Administrator must always approve the comment” does ALWAYS work. Is there a loophole here?
Forum: Fixing WordPress
In reply to: Comment Moderation Issue – need helpI did that, that’s why I’m confused. If the author of the post is logged in and comments, it’s completely bypassing this requirement.
I looked in comment.php, and that is the first check so it should be returning false and not allowing the comment to go live. But it isn’t being moderated.Other comments from visitors that are not the author get moderated.
What in the world could be causing this?
Forum: Plugins
In reply to: [WP Super Cache] [Plugin: WP Super Cache] Allow Editor role to Delete Cache?I too would love to know where we are with this. I now have (3) clients that I’m having to do their cache deletes manually because I can’t assign this to an Editor. Any status? I’ll even take an ugly hack at this point…
I used an older version of the acf plugin to solve this for my client – but we’re on version 3.3.2 still of WP. We haven’t updated to 3.4 as there are problems with a few other plugins he uses. I’m not sure if the older acf version will work on the latest WP.
Never mind – I found where I had saved version 3.1.9. WYSIWYG is now working again, just like ruthnis.
This is a pretty bad bug, so hopefully it will get resolved soon.
Could you share the old version of the plugin you have somehow? I have the SAME problem, and my client is completely freaking out! I need to roll back quickly.
THANK YOU!!! That was the secret, works perfect now. ??
I am so close, yet not there. New modified code below…
I can get this to work if I hard code the user id in the where clause, like post_author=4. But I can’t seem to grab the id of the currentuser and pass that to the where clause.
Can anyone with fresh eyes see my problem?function customRULVariableCharter( $custom_redirect_to, $variable, $user ) { global $wpdb, $current_user; get_currentuserinfo(); $pullcharter = $wpdb->get_row("SELECT post_name FROM $wpdb->posts WHERE post_author=$current_user->ID AND post_type='captain'", ARRAY_N); $postname = $pullcharter[0]; if( 'charter' == $variable ) { return $postname; } else { return $custom_redirect_to; } } add_filter( 'rul_replace_variable', 'customRULVariableCharter', 10, 3 );
Oh sure, give me the easy way out ??
Works perfect thanks – I guess at least I learned something doing it the hard way.For the Robots Meta column, I’ve got it narrowed down to a problem with the Codepress Admin Columns. With that activated, the Robots Meta column is displayed but doesn’t show up in the plugin to remove.
I’ve posted this with the Admin Columns plugin author – so hopefully he can figure out what’s going on.
Thanks again!
Hi Jivyb,
I might be able to help you, as I use custom post types with this plugin and they have their own custom taxonomy for their “categories”.
What I use in the title is %%term_title%%, which will return the custom taxonomy name.
Hope that helps!
I’ve managed to remove the filter box and the (4) additional SEO columns. Still struggling to remove the Robots Meta column from posts and pages, as doing an unset on the column doesn’t seem to be working.
Yes I know you can hide this with screen options – but I manage over 50 clients sites and it’s not feasible to go edit all these – especially if additional users are added to the site. I need to use functions in my theme code so I can push out one update.
For anyone else that needs code for your theme functions.php – here is what I have working. There might be a cleaner way to code this, but it’s working for me.
NOTE – I prefix all my functions with ‘xko’ for our company – but you really should change this so that it’s unique to you ??
—– Hide the SEO Columns (Score, KW, etc.) —–
This code will remove these additional (4) columns from the posts and page screens, without hacking original plugin code:function xko_seo_columns_filter( $columns ) { unset($columns['wpseo-score']); unset($columns['wpseo-title']); unset($columns['wpseo-metadesc']); unset($columns['wpseo-focuskw']); return $columns; } add_filter( 'manage_edit-post_columns', 'xko_seo_columns_filter', 10, 1 ); add_filter( 'manage_edit-page_columns', 'xko_seo_columns_filter', 10, 1 );
If you have additional custom post types, you need to add more filters. I had 6 additional custom post types ??
The syntax is like this:add_filter( 'manage_edit-CUSTOMPOSTTYPE_columns','xko_seo_columns_filter', 10, 1 );
So if your custom post type was ‘book’, the filter would be:
add_filter( 'manage_edit-book_columns', 'xko_seo_columns_filter',10, 1 );
—– Hide the SEO Filter Box —–
I’m using CSS to hide this, but passing it through a function so that you don’t have to go update the CSS file, and I’m already changing the functions.php – so it’s just one change for all my sites. Using an array / in_array function so I can remove from both posts and page (and any custom post types – see below):function xko_hide_seo_filter_box(){ $my_post_type = array('post','page'); global $post; if (in_array($post->post_type, $my_post_type)) { echo ' <style type="text/css"> #posts-filter .tablenav select[name=seo_filter] { display:none; } </style> '; } } add_action('admin_head-edit.php', 'xko_hide_seo_filter_box');
Now, if you have multiple custom post types, you can add them to the array. So to include the custom post type ‘book’ we have:
function xko_hide_seo_filter_box(){ $my_post_type = array('post','page','book'); global $post; if (in_array($post->post_type, $my_post_type)) { echo ' <style type="text/css"> #posts-filter .tablenav select[name=seo_filter] { display:none; } </style> '; } } add_action('admin_head-edit.php', 'xko_hide_seo_filter_box');
Hope this helps anyone else looking for a way to hide these without editing the plugin files. If I figure out why the Robots Meta doesn’t want to unset, I’ll come back and post the code.