- This topic has 22 replies, 7 voices, and was last updated 2 years, 11 months ago by Elvin.
-
AuthorPosts
-
April 28, 2021 at 6:24 pm #1754328ch1800
Is it possible to keep the latest previous GPP in my account’s download section please?
As I certainly won’t update to the new one as long as sections are removed from there.Thanks.
April 28, 2021 at 7:50 pm #1754401ElvinStaffCustomer SupportHi there,
The link for the older versions are not available on the download section, unfortunately.
If you wish to get the older version, you can send us a mail requesting for a copy of the older version and we’ll try get it for you. 🙂
April 28, 2021 at 8:03 pm #1754411ch1800Ha OK… noted, thanks.
April 28, 2021 at 8:05 pm #1754413ElvinStaffCustomer SupportNo problem. 🙂
April 28, 2021 at 8:52 pm #1754467TomLead DeveloperLead DeveloperIf you want to keep Sections but stay up to date (recommended), you can use this snippet:
add_filter( 'generate_premium_deprecated_modules', function( $modules ) { return array_diff( $modules, [ 'Sections' ] ); } );
Just keep in mind that Sections is now deprecated which means things may break in the future as WordPress moves away from the Classic editor.
April 28, 2021 at 9:20 pm #1754484GrahamHi Tom,
I run ClassicPress, which is a fork of WP4.9x and the latest version causes an error 500.
I tried the filter above in my child functions.php file, but it didn’t work.
I’ve uploaded an older version and changed the version number to 9.9.9
My error log showed:
PHP Fatal error: Uncaught Error: Call to undefined function register_block_type() in /home/xxxxx/public_html/wp-content/plugins/gp-premium/elements/class-block-elements.php:183
Is there another way to prevent block code functions from being installed?
April 28, 2021 at 9:27 pm #1754495ch1800Thanks Tom,
I appreciate your feedback but even if WP moves away from Classic, lots of users like me will keep using it whatever happens.
Gutenberg is really far from wide adoption.And the question is not how good/bad those blocks are. In fact, they are really good.
But the question is about the way they are implemented and this is really bad in terms of UX, usage logic and interface.
I work for small businesses and some of them want to keep updating their sites after handover. There are 0 chances to make them adopt blocks. Zero chance.OK, back to Sections module:
This snippet works fine the same way if you update an existing site using Sections, from version 1 to version 2:
it keeps sections active at first site install or if you update from an existing installation that was previously using sections.Problem is still that when wanting to change site from the library after that you lose the sections module!
The only solution I found for such cases is to revert back to GPP version 1, change site and then update GPP to version 2 again.Is there a solution for that?
Thanks.
April 29, 2021 at 8:18 am #1755861TomLead DeveloperLead DeveloperGraham – will get this fixed in the next version. For now, can you test the fix for me to make sure it’s all that’s required with ClassicPress?
In
wp-content/plugin/elements/class-block-elements.php
, find line 182, which looks like this:public function register_dynamic_blocks() {
After it, add this:
if ( ! function_exists( 'register_block_type' ) ) { return; }
So it looks like this:
public function register_dynamic_blocks() { if ( ! function_exists( 'register_block_type' ) ) { return; }
As for the Sections issue – as long as that filter is added it really shouldn’t matter. That filter will make it so “Sections” appears in the list of modules to activate/deactivate in “Appearance > GeneratePress”. Whether it’s a new site or existing site should make no difference.
April 29, 2021 at 10:11 am #1756056GrahamThanks Tom.
Adding the extra code allowed ClassicPress to work normally with the new GPP.
I didn’t add the filter for sections, as they still work as normal.
April 29, 2021 at 10:12 am #1756057TomLead DeveloperLead DeveloperGreat to hear. Fixed in 2.0.1 🙂
Thanks!
April 29, 2021 at 1:35 pm #1756384DavoodThank you for sharing the filter above. One questions about the filter though. I am a user of the wp.org code not ClassicPress. Am I correct that I could add the filter into a site specific plugin that we have to avoid needing a plugin?
April 29, 2021 at 5:52 pm #1756558ch1800This snippet doesn’t seem to have any èarticular effect if you update an existing site using Sections, from version 1 to version 2: sections are anyhow kept active if you update from an existing installation on version 1 that was previously using sections.
I tested the snippet on a site with version 1 that was NOT using sections and updated to version 2 and sections vanished…
I then tested on a new site installing version 2 from scratch with the snippet active and sections are not listed.So, what does this snippet do precisely?
Also, problem is still that when wanting to change site from the library after that you lose the sections module!
The only solution I found for such cases is to revert back to GPP version 1, change site and then update GPP to version 2 again.Is there a solution for that?
April 29, 2021 at 8:36 pm #1756651ElvinStaffCustomer SupportHi ch1800,
Tom’s filter here – https://generatepress.com/forums/topic/previous-latest-gpp-version-1-12-3/#post-1754467 – simply enables adds back the Section module so users can enable it.
The code Tom provided here – https://generatepress.com/forums/topic/previous-latest-gpp-version-1-12-3/#post-1755861 – is solely for Graham so ClassicPress works.
Have you updated to GP Premium 2.0.1 released today? I believe Tom just applied this fix.
@Davood
Have you tried updating to GP Premium 2.0.1 as well? Try updating and try Tom’s filter here https://generatepress.com/forums/topic/previous-latest-gpp-version-1-12-3/#post-1754467
Let us know if there are any errors.
April 29, 2021 at 8:46 pm #1756663ch1800Hi Elvin,
I updated my post above probably during the time you were replying to this.
Please read it again as I just made several tests.Yes, I’m solely referring to Tom’s first snippet here.
And yes, my latest tests are with version 2.0.1 but I don’t see any difference regarding sections.
Summary of my previous post:
– Sections are kept active *anyhow* (with or without the snippet) if the previous version had them active
– I tested the snippet on a site with version 1 that was NOT using sections and updated to version 2 and sections vanished…
– I then tested on a new site installing version 2 from scratch with the snippet active and sections are not listed.
– when wanting to change site from the library after updating to version 2 with sections active, you lose the sections module.Thanks.
April 29, 2021 at 10:35 pm #1756795ElvinStaffCustomer SupportI see.
What happens if you try this instead?
add_filter( 'generate_premium_deprecated_modules', function( $modules ) { foreach ($modules as $key => $value){ if ($value == 'Sections') { unset($modules[$key]); } } return $modules; });
-
AuthorPosts
- You must be logged in to reply to this topic.