Brad Mettee
Forum Replies Created
-
Has the above code been helpful?
I’ve also determined that an Admin level has the same problem editing their own comments. Edit once, cancel, can’t edit again until page reload.
I’m also hooking comment_text filter. (there’s an open issue at github about it too, but it can be worked around for now)
// make any external links in a comment be opened in a new window/tab by adding 'target="_blank"' to the 'a' tag function nwf_comment_text($content, $comment) // should have 3 but simple comment editing only sends 2, $args) { $content = nwf_links_add_target($content, '_blank'); return $content; } // nwf_comment_text add_filter('comment_text', 'nwf_comment_text', 100, 2);
Nothing terribly complicated about this. No modifications to any core or SCE source code either.
Also found out, admin level user has same problem on their own comments, not just others.
Here’s the code:`
// hook into the sce_allow_delete filter, dis-allow users from deleting their comments unless nwf_allow_comment_delete capability is true (capability available on contributor and above)
function nwf_allow_comment_delete($allow_delete)
{
$allow_delete = !$allow_delete ? current_user_can(‘nwf_allow_comment_delete’, true) : $allow_delete;
return $allow_delete;
} // nwf_allow_comment_delete
add_filter( ‘sce_allow_delete’, ‘nwf_allow_comment_delete’, 100);// hook into sce_unlimited_editing to allow site admin/editor to edit any comment, regardless of how long it’s been up
function nwf_sce_unlimited_comment_edit($allow, $comment)
{
$allow = !$allow ? current_user_can(‘editor’, true) : $allow;
return $allow;
} // nwf_sce_unlimited_comment_edit
add_filter( ‘sce_unlimited_editing’, ‘nwf_sce_unlimited_comment_edit’, 1, 2);// hook into sce_cookie_bypass to allow site admin/editor to edit any comment, regardless of how long it’s been up
function nwf_sce_can_edit_cookie_bypass($bypass, $comment, $comment_id, $post_id, $user_id )
{
if ( $bypass || current_user_can(‘editor’, true) ) return true;
if ( 0 != $user_id && $comment->user_id == $user_id )
{
$bypass = true;
}
return $bypass;
} // nwf_sce_can_edit_cookie_bypass
add_filter( ‘sce_can_edit_cookie_bypass’, ‘nwf_sce_can_edit_cookie_bypass’, 10, 5);`- This reply was modified 5 years, 8 months ago by Brad Mettee.
Thanks Gabriel.
It’s not urgent, but I figured I’d save other developers some headaches in the future trying to track down a phantom problem.
I’ve solved it for now adding a filter. I’m worried that using CSS will cause it to be invisible where it’s actually needed.
function local_wppb_remove_blank_li($showit, $field, $form_type, $role, $user_id) { if ( $field['field'] == 'reCAPTCHA' && $form_type == 'edit_profile') { return false; } return true; } // nwf_wppb_remove_blank_li add_filter('wppb_output_display_form_field', 'local_wppb_remove_blank_li', 10, 5);
No issues with notice on new posts or new custom post types. Both types of notices arrived in email as configured.
Beta seems to work fine. No more duplicates sent on post, or custom post type, updates.
We’re using Gutenberg for main blog entries, and TinyMCE for a custom post type. Duplicates only occur when using Gutenberg AND Customify theme or Profile Builder. Basically it seems to be Gutenberg and meta blocks from any theme or plugin.
Over the weekend I found a second value being used, “meta_box” also gets used, but under different circumstances (doesn’t look like they’ll both be used at the same time). I think the wordpress core has had some additions that aren’t consistent.
My override line is now:
if ( isset($_GET) && count($_GET) > 0 && (isset($_GET['meta-box-loader']) || isset($_GET['meta_box'])) )
Also found what might be another, unrelated, problem:
helpers.php
function bnfw_get_user_select_class indicates to use Ajax for additional users when user_count > 100
function bnfw_render_users_dropdown will use Ajax when user_count > 200Shouldn’t these two counts match?