• Plugin Author Mike Martel

    (@mike_cowobo)


    This is the migration guide for beta testers of WP Tiles 1.0.

    If you are migrating from any WP Tiles version before 1.0, please carefully read the instructions below. In summary:

    • The shortcode has changed – prepare to replace all your shortcodes
    • Most CSS selectors have changed – your custom CSS won’t apply automatically
    • Template tags (eg. the_wp_tiles()) still exist, but need to be changed, or run in backward compat mode
    • Static menu / Tile position gist – if you you use the tile position gist, it will no longer work. An updated version will be added

    Again, we tried our best to avoid backward compatibility issues, but considering that the changes improve the usability of the plugin by so much, maintaining full backward compatibility would have led to a diminished experience.

    If you run into any other breaking changes. Please let me know, preferable via the GitHub repo.

    Shortcode Changes

    The shortcode has changed significantly and none of the old parameters are still valid. If one of the old parameters (eg. posts_query or display) is detected, WP Tiles will run in compatibility mode – ie. the shortcode will try to render using the old settings. This is not fool-proof. So expect to have to rewrite your shortcodes. The easiest way to do it is by using the shortcode builder in the editor.

    • posts_query is completely deprecated and [Display Posts Shortcode]() syntax is used instead. For example: [wp-tiles posts_query="post_type=post&posts_per_page=5"] becomes [wp-tiles post_type=post posts_per_page=5]
    • display is completely split up and parameter names have changed. Use the shortcode builder to recreate your settings

    CSS Changes

    The classes for tiles have changed completely. All classes are now prefixed with wp-tiles- and should be usable almost entirely without nesting selectors. For this reason, a custom wp-tiles.css will no longer be loaded from your theme (it would completely break the plugin). To override the WP Tiles css, return its path to the wp_tiles_stylesheet filter. Eg.:

    add_filter( 'wp_tiles_stylesheet', 'my_theme_wp_tiles_styleheet' );
    function my_theme_wp_tiles_styleheet() {
    	return get_stylesheet_directory_uri() . '/css/wp-tiles.css';
    }

    To disable the WP Tiles stylesheet, return false:
    add_filter( 'wp_tiles_stylesheet', '__return_false' );

    Template Tags

    Only the_loop_wp_tiles without parameters should work unchanged and in compatibility mode automatically. Both the_category_wp_tiles and the_wp_tiles now expect 2 parameters – $posts and $options. If you pass false for $options the template tags will run in compatibility mode. For example:

    the_wp_tiles( array(
                  'display' => array( ... some arguments ... )
    ), false );

    Otherwise, documentation on the $options array will follow later. Use it to convert your template tags to WP Tiles 1.0.

    Please note: the backward compatibility layer will be removed from the plugin in due time. Make sure you make your website compatible with WP Tiles 1.x

    https://www.ads-software.com/plugins/wp-tiles/

  • The topic ‘[1.0 BETA] Migration Guide’ is closed to new replies.