cagov / ca-design-system-gutenberg-blocks

DEPRECATED: CA Design System Gutenberg blocks for WordPress.
MIT License
4 stars 5 forks source link

Allow for disabling of Pantheon functionality #79

Closed claytoncollie closed 9 months ago

claytoncollie commented 9 months ago

Adds a filter that defaults to true

Will allow another theme or plugin to disable this entire conditional

claytoncollie commented 9 months ago

@chachasikes @aaronhans @Danny-Guzman @chachacalifornia @zakiya

Hi everyone.

I know this repo is a bit stale but we are using it on a CaGov site right now.

I wasn't sure who to contact so tagged everyone I see under the Contributors section.

Would it be possible to merge this PR so I can pull down the latest from main and use it on my site?

chachasikes commented 9 months ago

@zakiya Assigning this back to you for testing and review. My initial test is working on Pantheon.

chachasikes commented 9 months ago

We have more of a response and hope to share it soon.

chachasikes commented 9 months ago

Question for @claytoncollie

We are working on a PR for main.

Question about your implementation of apply_filters - Can you tell us a little more about how you are calling this function in the theme. It would be helpful to also test the method you are using.

Also - is this the same reference for the method that you are using? https://developer.wordpress.org/reference/functions/apply_filters/

cc @zakiya

zakiya commented 9 months ago

Also can you clarify what theme you are using?

claytoncollie commented 8 months ago

@zakiya @chachasikes

Yes. This is the WordPress Core apply_filters function that you linked to earlier. We will call this filter on the init hook like so.

add_action( 'init', function() {
    add_filter( 'cagov_gb_is_pantheon', '__return_false' );
} );

We are using a custom theme forked from this repository. The only thing we need from this plugin is the blocks. All of the other features will be disabled.