timber / starter-theme

The "_s" for Timber: a dead-simple theme that you can build anything from
MIT License
812 stars 274 forks source link

Use WorDBless #113

Closed szepeviktor closed 3 years ago

szepeviktor commented 3 years ago

I'm no developer!! Please help me fix $this->assertTrue(current_theme_supports('post-thumbnails'));

szepeviktor commented 3 years ago

@jarednova Could you help me here with one small advice?

szepeviktor commented 3 years ago

Dear Viktor! Read the public docs! https://developer.wordpress.org/reference/functions/add_theme_support/#post-thumbnails

szepeviktor commented 3 years ago

Did not help :(

szepeviktor commented 3 years ago

As far as my debugging goes StarterSite::theme_supports() is not called. Maybe after_setup_theme is not fired?

szepeviktor commented 3 years ago

did_action('after_setup_theme') in the constructor returns 1

jarednova commented 3 years ago

Just checked out WordBless, very cool! Let me see if I can get this up locally and figure out what's giving us the problem ...

szepeviktor commented 3 years ago

Maybe because of https://github.com/Automattic/wordbless/issues/27

jarednova commented 3 years ago

@szepeviktor I similarly narrowed things down to that place where it (seems) that the after_theme_setup hook is not triggered. It's supposed to occur on each page load: https://developer.wordpress.org/reference/hooks/after_setup_theme/

So the question here: is each test a page load? Does it even matter? Shouldn't this still execute and have the theme support function loaded?

szepeviktor commented 3 years ago

Everything would be okay if there would be no switch_theme() in the test setup function.

jarednova commented 3 years ago

I just disabled it, but still hit the error? If you're seeing that removing it works, please push so we can check it out!

szepeviktor commented 3 years ago

do_action( 'after_setup_theme' );

My "solution" is to fire that action manually.

The other could be to activate Starter Theme in bootstrap.php

jarednova commented 3 years ago

very very nice!