public function info_slider($atts, $content = null) {
$args = shortcode_atts(
array(
'orientation' => null,
'title' => null,
),
$atts
);
wp_enqueue_style('css-custom-app-info-slider', plugin_dir_url(__FILE__).'assets/css/info-slider.css');
wp_enqueue_script('js-custom-app-info-slider', plugin_dir_url(__FILE__).'assets/js/info-slider.js', array( 'jquery' ), null, true );
$info = '';
$box = '<div class="titles">'.'<h3>'.$args['title'].'</h3><ul>';
$slides = '<ul class="slides">';
$btn = '<span class="btn"></span>';
$box .= '</ul>'.do_shortcode($btn).'</div>';
$slides .= '</ul>';
$output = '<div class="info-slider">
<div class="wrap">
'.$slides.'
'.$box.'
</div>
<div class="text">'.$info.'</div>
</div>';
return $output;
}
I am doing this in a custom plugin. The class including the function is called when the plugins_loaded hook is called.
public function __construct() {
add_action('plugins_loaded', [$this, 'init']);
}
UPDATE:
After reinstallation minifcation seems to work but there was also a missunderstanding from my part. I am using this plugin for quite some time and wasn’t aware of the FVM 3 features that requires me to manually list which files are defered or parsed at render blocking. When I list them it works.
-
This reply was modified 2 years, 8 months ago by Insomnia88.
-
This reply was modified 2 years, 8 months ago by Insomnia88.
-
This reply was modified 2 years, 8 months ago by Insomnia88.