Dekadinious
Forum Replies Created
-
Forum: Plugins
In reply to: [LiteSpeed Cache] Weird javascript issue…I get the same problem with Google Analytics. The only page that is tracked is “/”, the root page. When navigating the site, nothing changes on Analytics Real-time. But when refreshing the page, the correct page appears.
Disabling Litespeed Cache fixes this. One can ask oneself what the point is if all JS-files has to be excluded?
Forum: Plugins
In reply to: [LiteSpeed Cache] Weird javascript issue…Hello!
Disabling js-combine have seemed to fix the issue with the slidein not closing.
But I also have a Facebook like button at the bottom of every post. This is the standard code from Facebook. This does not appear if you come from the front page, but does appear if you refresh the page while on the post.
Looking at the source code shows that the iFrame is not loaded at all when it does not show up. Just an empty div. Disabling Litespeed fixes this problem also. I have tried different settings and this problem is tied to minifying of JS-files.
How do we fix both these issues with the best performance of the cache?
Forum: Plugins
In reply to: [Asset CleanUp: Page Speed Booster] Do not load for contributorsWell, I don’t load the classic editor so I can’t comment on that. I have had to use these lines in a custom script loaded for contributors to remove it:
wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'meta-box-wpassetcleanup_page_options' ); // Asset Cleanup wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'meta-box-wpassetcleanup_asset_list' ); // Asset Cleanup 2Here is a screenshot. It also appears at the bottom:
Hope it helps!
Forum: Plugins
In reply to: [Asset CleanUp: Page Speed Booster] Do not load for contributorsYes, that is correct. I logged out of the admin account and into a contributor account. Granted, this contributor has the capability of uploading files. But I guess you actually check the role name and not just the capabilities?
It’s only loaded in Gutenberg though.
Forum: Plugins
In reply to: [LiteSpeed Cache] Weird javascript issue…Is there an easy way to revert to my current settings if I reset to the default settings?
Forum: Fixing WordPress
In reply to: Redirect users after submitting post for review in GutenbergI have found this, but it seems very hacky: https://wordpress.stackexchange.com/questions/319054/trigger-javascript-on-gutenberg-block-editor-save
Has anything changed in two years?
Forum: Fixing WordPress
In reply to: Redirect users after submitting post for review in GutenbergThat will not word because this redirects users when clicking the “Add new post”-button. So they never get to their new post.
I have tried hooking into “transition_post_status”, but then Gutenberg gives an error stating that the response is not valid JSON.
I don’t know how to get this to work.
Forum: Plugins
In reply to: [Post Status Notifier Lite] Getting two email notifications as adminI did some research and it seems like the post status “pending” is set twice from WordPress, and that caused the problem. It’s solved now by excluding that 🙂
Forum: Plugins
In reply to: [WP Popular Posts] Random posts from a range of popular posts?Yeah, I am. It didn’t even occur to me to just query 100 posts from the plugin and show random posts from that dataset… Thank you for opening up my brain a little bit! 🙂
Forum: Plugins
In reply to: [LiteSpeed Cache] WordPress Popular Posts PluginThe problem was that WPP was set to lazy load images and Litespeed was too. I disabled it for WPP and the images are now showing fine.
Forum: Fixing WordPress
In reply to: Set default columns and screen options for user role?Yes, I see. I just nuked everything with CSS and will just cross my fingers 🙂
Forum: Fixing WordPress
In reply to: Limit queried media library objects to that of current postYeah, it’s a complicated issue for sure!
I think I’ll just take my chances with duplicate image uploads for now. A couple of megabytes of data here and there is not too expensive these days 🙂
Forum: Fixing WordPress
In reply to: Set default columns and screen options for user role?Yes, the thought has crossed my mind. But I am not really a fan of it… Some of the plugins are not that smart and are loading sensitive information to contributors too. That is something that the plugin author needs to fix though.
I was hoping there was some kind of for/each I could run for each outputted admin column and say if it does NOT match my criteria, just don’t show it.
But I am guessing it’s not?
CSS will have to do in the mean time.
Forum: Fixing WordPress
In reply to: Limit queried media library objects to that of current postI actually had an aha-moment. I did not need the global $post at all. Just take it from the $_POST:
$query['post_parent'] = $_POST['post_id'];Now it works, and I don’t need to filter on the author at all 🙂
Forum: Fixing WordPress
In reply to: Limit queried media library objects to that of current postThank you for that code!
That exact idea has struck my mind. But I want to make it future-proof so that I later can filter on media from certain contributors etc. So I think I would like the author of the media to stay intact.
This is my work in progress. The commented line will show the media for only the author. I am trying to incorporate post-ID into this to query only media associated with the post.
I have no idea if this is correct. Currently, I am struggling with global $post not being defined. Therefore I can’t get the post ID.
function wpb_show_current_user_attachments( $query ) { $referer = parse_url(wp_get_referer()); parse_str($referer['query'], $params); if (isset($params['post'])){ $post_type = get_post_type($params['post']); } else if (strpos($referer['path'], 'post-new.php') !== false && !isset($params['post_type'])){ $post_type = 'post'; } else { $post_type = ''; } if ( $post_type == 'post' ) { global $post; $id = $post->ID; write_log($id); } $user_id = get_current_user_id(); if ( $user_id && check_user_role(array('contributor')) ) { //$query['author'] = $user_id; $query['post_parent'] = $id; } return $query; } add_filter( 'ajax_query_attachments_args', 'wpb_show_current_user_attachments' );