Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What a wonderful plugin #1

Open
chichille opened this issue Mar 30, 2023 · 0 comments
Open

What a wonderful plugin #1

chichille opened this issue Mar 30, 2023 · 0 comments

Comments

@chichille
Copy link

Incredible but true, i developed an addon for Elementor and I was just looking for sources to integrate the features you created.
To consolidate the code I had to make some contributions that I give you here because i don't have a Wordpress account.
Mon site de démonstration: EAC
Of course the download is free (GPLv2+)

Manager.php
Add action 'before_delete_post' to clean the DB

Method 'get_current_page_id'
Replace 'wc_get_current_page_id' by 'wc_get_page_id'

Method 'has_assigned_template'
Added is_category() et is_tag() to check the archive before is_tax()

Method 'update_template_location' check if 'show_on' is set
if ( in_array( $type, array( SiteHeader::TYPE, SiteFooter::TYPE ), true ) && isset( $settings['show_on'] ) ) { ... }
Force add_option autoloaded to 'no'

SiteHeader.php and SiteFooter.php
Export/import not working for importing a model
Method 'get_properties' added new property
'cpt' => [ 'elementor_library' ],

Method 'print_elements_with_wrapper'
Check the "DOM Optimization" experiment feature to avoid loading unnecessary divs
$is_dom_optimization_active = Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' );

PageLayoutSettings.php
register_post_meta: because $meta_name is empty 'Appearance/Widgets' is broken
Method 'enqueue_scripts' before loading the script i check the screen ID
if ( 'widgets' !== get_current_screen()->id ) {
...
}

Templates/BlankPage.php & SiteHeader.php
Added 'body_open();' after body_class();

Create new file compatibility-themes.php
For twenty of the most popular themes like 'Oceanwp, GeneratePress Hestia Astra Storefront Hello...'
I created actions before and after the header/footer to add the DOM structures corresponding to the current theme.
I'm not sure if this is the right method but...

And finally I test if the current theme is a block based theme to load or not the 'Header and Footer' features
because it doesn't work and I'm not familiar with block themes
if ( function_exists( 'wp_is_block_theme' ) && ! wp_is_block_theme() ) { load component } WP 5.9

I just finished the navigation menu and I still have some functionality to add like site title, logo, page title, breadcrumb...

Thanks again for your superb work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant