Mecha CMS

Mecha CMS blog and documentation.

Behaviour Changes in Default Shortcodes

Updated: Sunday, 07 August 2016

There are some behaviour changes in the default shortcode results.

Default shortcodes for URL are now handled by do_shortcode_url and do_shortcode_url_* functions to automate the trailing slash addition at the beginning of shortcode parameter.

Result changes of the default shortcodes are described as follow, assuming that . is your home page URL:

{{url}}

Pattern< 1.2.7>= 1.2.7
{{url}}./.
{{url}}foo./foo./foo
{{url}}/foo.//foo./foo
{{url}}?foo./?foo.?foo
{{url}}&foo./&foo.&foo
{{url}}#foo./#foo.#foo
{{url:}}Broken.Broken.
{{url:foo}}./foo./foo
{{url:/foo}}.//foo./foo
{{url:?foo}}./?foo.?foo
{{url:&foo}}./&foo.&foo
{{url:#foo}}./#foo.#foo
href="{{url}}"href="./"href="."
href="{{url}}foo"href="./foo"href="./foo"
href="{{url}}/foo"href=".//foo"href="./foo"
href="{{url}}?foo"href="./?foo"href=".?foo"
href="{{url}}&foo"href="./&foo"href=".&foo"
href="{{url}}#foo"href="./#foo"href=".#foo"

{{asset}}

Pattern< 1.2.7>= 1.2.7
{{asset}}./lot/assets/./lot/assets
{{asset}}foo.jpg./lot/assets/foo.jpg./lot/assets/foo.jpg
{{asset}}/foo.jpg./lot/assets//foo.jpg./lot/assets/foo.jpg
{{asset}}?foo.jpg./lot/assets/?foo.jpg./lot/assets?foo.jpg
{{asset}}&foo.jpg./lot/assets/&foo.jpg./lot/assets&foo.jpg
{{asset}}#foo.jpg./lot/assets/#foo.jpg./lot/assets#foo.jpg
{{asset:}}Broken.Broken.
{{asset:foo.jpg}}./lot/assets/foo.jpg./lot/assets/foo.jpg
{{asset:/foo.jpg}}./lot/assets//foo.jpg./lot/assets/foo.jpg
{{asset:?foo.jpg}}./lot/assets/?foo.jpg./lot/assets?foo.jpg
{{asset:&foo.jpg}}./lot/assets/&foo.jpg./lot/assets&foo.jpg
{{asset:#foo.jpg}}./lot/assets/#foo.jpg./lot/assets#foo.jpg
href="{{asset}}"href="./lot/assets/"href="./lot/assets"
href="{{asset}}foo.jpg"href="./lot/assets/foo.jpg"href="./lot/assets/foo.jpg"
href="{{asset}}/foo.jpg"href="./lot/assets//foo.jpg"href="./lot/assets/foo.jpg"
href="{{asset}}?foo.jpg"href="./lot/assets/?foo.jpg"href="./lot/assets?foo.jpg"
href="{{asset}}&foo.jpg"href="./lot/assets/&foo.jpg"href="./lot/assets&foo.jpg"
href="{{asset}}#foo.jpg"href="./lot/assets/#foo.jpg"href="./lot/assets#foo.jpg"

{{url.current}}

Assuming that * is your current URL:

Pattern< 1.2.7>= 1.2.7
{{url.current}}**
{{url.current}}foo*foo*/foo
{{url.current}}/foo*/foo*/foo
{{url.current}}?foo*?foo*?foo
{{url.current}}&foo*&foo*&foo
{{url.current}}#foo*#foo*#foo
{{url.current:}}Not available.Broken.
{{url.current:foo}}Not available.*/foo
{{url.current:/foo}}Not available.*/foo
{{url.current:?foo}}Not available.*?foo
{{url.current:&foo}}Not available.*&foo
{{url.current:#foo}}Not available.*#foo
href="{{url.current}}"href="*"href="*"
href="{{url.current}}foo"href="*foo"href="*/foo"
href="{{url.current}}/foo"href="*/foo"href="*/foo"
href="{{url.current}}?foo"href="*?foo"href="*?foo"
href="{{url.current}}&foo"href="*&foo"href="*&foo"
href="{{url.current}}#foo"href="*#foo"href="*#foo"

{{url.@}}

Assuming that @ is the page type.

Example: ./@/foo is the same as ./tag/foo if the shortcode is {{url.tag:foo}}

Pattern< 1.2.7>= 1.2.7
{{url.@}}./@/./@
{{url.@}}foo./@/foo./@/foo
{{url.@}}/foo./@//foo./@/foo
{{url.@}}?foo./@/?foo./@?foo
{{url.@}}&foo./@/&foo./@&foo
{{url.@}}#foo./@/#foo./@#foo
{{url.@:}}Broken.Broken.
{{url.@:foo}}./@/foo./@/foo
{{url.@:/foo}}./@//foo./@/foo
{{url.@:?foo}}./@/?foo./@?foo
{{url.@:&foo}}./@/&foo./@&foo
{{url.@:#foo}}./@/#foo./@#foo
href="{{url.@}}"href="./@/"href="./@"
href="{{url.@}}foo"href="./@/foo"href="./@/foo"
href="{{url.@}}/foo"href="./@//foo"href="./@/foo"
href="{{url.@}}?foo"href="./@/?foo"href="./@?foo"
href="{{url.@}}&foo"href="./@/&foo"href="./@&foo"
href="{{url.@}}#foo"href="./@/#foo"href="./@#foo"

Removed shortcodes:

  • {{url.home}}
Donation and Email Subscription