Description
Implement "oik_loaded" action for oik-cssRegardless of whether there are any shortcodes we apply our logic for filtering 'the_content' The call to bw_better_autop() takes a parameter to control whether the bw_autop() function is called to perform wpautop logic or not. When it's a block based theme the value is true when PHP is being run in the command line interface (CLI) false otherwise. This is a pragmatic solution for PHPUnit testing. For classic themes the option field is a checkbox that is ticked when the wpautop() processing is to be disabled. So we need to negate the value when calling bw_better_autop(). Note: Most of the better autop logic applies regardless of the settting for bw_autop Part
Usage
oik_css_oik_loaded();Parameters
Returns
voidSource
File name: oik-css/oik-css.phpLines:
1 to 12 of 12
function oik_css_oik_loaded() { $theme =wp_get_theme(); $is_block_theme=$theme->is_block_theme(); if ( $is_block_theme ) { bw_better_autop( PHP_SAPI === 'cli' ); } else { $bw_disable_autop=bw_get_option( "bw_autop", "bw_css_options" ); $bw_autop = ! $bw_disable_autop; bw_better_autop( $bw_autop ); } add_action( "oik_add_shortcodes", "oik_css_init" ); }View on GitHub View on Trac
