Scratch-Theme icon indicating copy to clipboard operation
Scratch-Theme copied to clipboard

Replaced get_version function

Open ankitaraikundalia opened this issue 11 years ago • 4 comments

Why is 'fw()->theme->manifest->get_version()' replaced with '1.0' in all files of the scratch theme?

ankitaraikundalia avatar Dec 05 '14 07:12 ankitaraikundalia

The theme manifest loads some parameters from theme's style.css.

ghost avatar Dec 05 '14 09:12 ghost

@moldcraft - 'fw()->theme->manifest->get_version()' was used in old scratch theme. But, in the new scratch theme, it is replaced by the static version 1.0

Example: In static.php of the new theme, the below code is written:

// Add Lato font, used in the main stylesheet.
wp_enqueue_style(
    'fw-theme-lato',
    fw_theme_font_url(),
    array(),
    '1.0'
);

In static.php the older version of theme, the below code was written:

// Add Lato font, used in the main stylesheet.
wp_enqueue_style(
    'fw-theme-lato',
    fw_theme_font_url(),
    array(),
    fw()->theme->manifest->get_version()
);

Why is it changed?

ankitaraikundalia avatar Dec 05 '14 09:12 ankitaraikundalia

In the new theme version, the static.php has nothing with the framework, now the theme uses Theme Include, so we cannot use framework functions anymore because the framework may not exist. Check out the Changelog for v2.1.0

ghost avatar Dec 05 '14 10:12 ghost

@moldcraft Thank you..

ankitaraikundalia avatar Dec 05 '14 10:12 ankitaraikundalia