KS
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Hierarchical CPT with year slugHello @bcworkz many thanks for your very useful reply! I hadn’t come across that filter before, very interesting.
Yes, the number slug restriction is due to pagination and in our case, it’s very unlikely to have pagination for 2024 pages, so that shouldn’t be an issue. I’m still in two minds about whether to disable the filter or not, it is useful to stop duplicates, especially if other people are working on the site and forgetting to be careful.
Either way, thanks a lot for pointing me in the direction of this filter!
Forum: Themes and Templates
In reply to: [GeneratePress] generate_do_wp_block_margin_bottomHello Tom, ah many thanks! I didn’t know about this dynamic caching of CSS function, even though I have built a whole bunch of sites with GP. Thanks for pointing this out!
Forum: Themes and Templates
In reply to: [GeneratePress] generate_do_wp_block_margin_bottomHi David, many thanks for the quick reply! I tried this, unfortunately it didn’t help solve the issue.
It’s a bit odd, if I remove the actual filter in /inc/css-output.php (lines 550-553) just to test, still nothing happens and the CSS code still gets output into the inline CSS “generate-style-inline-css”. Only if I remove:
wp_add_inline_style( 'generate-style', wp_strip_all_tags( $css ) );
in the generate_enqueue_dynamic_css function, does I get rid of the CSS for that bottom margin. But then of course, I lose all other GP inline styling.
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementI can only concur with @fruchtfliege. It used to work, Borlabs hasn’t changed their setup and I find it a bit disappointing that you get hung up on me saying “Borlabs’ guess is .. ” – they just gave their opinion on why the combination of the two plugins doesn’t work any longer. It doesn’t mean that their plugins breaks the functionality and they have something to fix or that somehow you need to debug their plugin.
This functionality used to work, for both me and @fruchtfliege , later versions of gTranslate seem to have changed how it gets initialised and this causes issues in relation to cookie control and the GDPR.
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementHi @edo888 thanks for the reply, but please see above https://www.ads-software.com/support/topic/widget-code-replacement/#post-16839734.
Borlabs did look into it and said their shortcode doesn’t block anything.Their guess was that gTranslate loads the relevant classes on page load and when it’s delayed through a cookie function, it doesn’t load the correct classes as the page has already loaded. So it seems like gTranslate is causing the issue here, not Borlabs, as they just provide a standard cookie functionality.
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementHi @fruchtfliege , did you ever manage to figure this out? There hasn’t been any more input from gTranslate.
Forum: Plugins
In reply to: [Custom Blocks Constructor - Lazy Blocks] Getting $attributes data in themeI figured out how to get the data I needed. In the main repeater field, I changed to “save in meta”, then I could use this:
<ul> <?php $repeater = get_lzb_meta( 'toc' ); foreach ( $repeater as $inner ) { ?> <li><a href="#<?php echo $inner['toc_id']; ?>"><?php echo $inner['toc_title']; ?></a></li> <?php } ?> </ul>
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementHello @edo888, would be great with some input on whether GTranslate sets the above classes on page load and if so, if there is a way to delay this process until cookies are confirmed, or a way to reset them. Thanks!
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementHi @edo888 many thanks for the reply!
I was in contact with Borlabs, they said their shortcode doesn’t modify anything that their shortcode blocks. So it’s not their plugin that actively strips out the glink nturl notranslate gt_raw_link-xxjexk classes.
Their guess was that gTranslate sets these classes with JavaScript on page load, and while in our case the flags only show after cookies are confirmed, this doesn’t happen.
Could that be the reason? Is there anyway to delay the gTranslate function, until after cookies are confirmed?
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementJust as a bit of additional info: since I updated both the Borlabs Cookie and gTranslate plugins, I wasn’t sure which plugin caused issues. Keeping Borlabs updated to latest version, but rolling gTranslate back to 2.9.13 and then running:
<?php echo do_shortcode('[borlabs-cookie id="google-translate" type="cookie"][gtranslate][/borlabs-cookie]'); ?>
works fine. Running the same code on gTranslate 3.0.3 (or 3.0.1 which I also tried), nothing is output. So it does seem like gTranslate doesn’t cope well being loaded inside another shortcode. And as mentioned above, if running:
<?php echo do_shortcode('[borlabs-cookie id="google-translate" type="cookie"][gt-link lang="en" label="" widget_look="flags_name"][/borlabs-cookie]'); ?>
the flags show, but nothing happens if they get clicked. I don’t know what technically is causing this, but it seems like gTranslate doesn’t fully load all its code, when getting loaded inside another shortcode.
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementI do still have one problem. Previously I could wrap the gTranslate inside another shortcode – for Borlabs Cookies – like this:
<?php echo do_shortcode('[borlabs-cookie id="google-translate" type="cookie"][gtranslate][/borlabs-cookie]'); ?>
and it was possible to show or hide flags, depending on whether cookies were accepted. If I run this now, with gt-link:
<?php echo do_shortcode('[borlabs-cookie id="google-translate" type="cookie"][gt-link lang="en" label="" widget_look="flags_name"][/borlabs-cookie]'); ?>
the flags show if I allow cookies, but nothing happens if I click on them. If I look at the HTML, it looks like this:
<a href="#" data-gt-lang="en" class="gt-current-lang"><img src="/wp-content/plugins/gtranslate/flags/24/en.png" width="24" height="24" alt="en" loading="lazy"> <span></span></a>
If I don’t wrap the gTranslate shortcode in the Borlabs shortcode, instead it outputs this:
<a href="#" data-gt-lang="en" class="glink nturl notranslate gt_raw_link-xxjexk gt-current-lang" title="English"><img src="/wp-content/plugins/gtranslate/flags/24/en.png" width="24" height="24" alt="en" loading="lazy"> <span></span></a>
which works fine. I don’t know if it’s Borlabs or gTranslate that doesn’t play nice with the other plugin?
Forum: Plugins
In reply to: [Translate Wordpress with GTranslate] Widget code replacementI could get it to work with:
<?php echo do_shortcode('[gt-link lang="en" label="" widget_look="flags_name"]'); ?> <a href="#" onclick="doGTranslate('en|en');location.;return false;" class="glink nturl notranslate"><img src="/wp-content/plugins/gtranslate/flags/24/fr.png" height="24" width="24" alt="Fran?ais"></a> <?php echo do_shortcode('[gt-link lang="de" label="" widget_look="flags_name"]'); ?> <?php echo do_shortcode('[gt-link lang="it" label="" widget_look="flags_name"]'); ?> <?php echo do_shortcode('[gt-link lang="sv" label="" widget_look="flags_name"]'); ?>
but it doesn’t look very clean. But perhaps this is the only way to do it, if Widget Code is gone?
Hi Jory, yes that’s what I was a bit unsure about. I presumed the standard media modal instance included the filtration by type (including uploaded-by-post) as it shows in the media gallery or when adding a featured image. I thought maybe Pods had specifically limited the selection, but perhaps I was wrong and only a date filter is standard in the media function.
As a temporary solution to get my posts updated, I installed this plugin https://www.ads-software.com/plugins/enhanced-media-library/, which added the “uploaded to this post” dropdown (as well as a lot of other filters).
Hi Paul, many thanks for the reply, I have created a feature request here https://github.com/pods-framework/pods/issues/7092
Personally, I don’t really need a setting, I just need it temporarily as I’m manually updating a lot of posts after moving to Pods. Since the media popup normally seems to include the ability to filter on type (uploaded to post, file type etc), I figured this dropdown was blocked when Pods Gallery loads the WP media popup function, but unfortunately I can’t figure out where in the code this is defined.