calderawp/magic-tags

Magic Tag rendering system.

2.2.0 2017-06-21 20:38 UTC

This package is not auto-updated.

Last update: 2024-10-26 17:34:59 UTC


README

Magic Tags renderer

Scrutinizer Code Quality Code Coverage Build Status

Using it (Making The Magic Happen)

$magic = new \calderawp\filter\magictag();
echo $magic->do_magic_tag('{post:custom_field}');

Built in tags

  • {user:[ field | meta field ]}
    retrieves field or meta field of the current logged in user. e.g. {user:first_name} {user:last_name}
  • {_GET:[name]}
    A GET var name. $_GET['page'] is {_GET:page}
  • {_POST:[name]}
    A POST var name. $_POST['page'] is {_POST:page} -{_REQUEST:[name]}
    A REQUEST var name. $_REQUEST['page'] is {_REQUEST:page}
  • {date:[format]}
    A PHP date format string. {date:Y-m-d} {date:F j, Y, g:i a}
  • {post:[ [field | meta field] | [ post_id : [ field | meta field ] ] ] }
    Post field or meta field. Array fields withh be imploded into a comma-separated list. Optional Post ID and field. {post:post_title} or {post:223:post_title} to get the tiel of post ID 223
  • {ip}
    IP address of the visitor

Extending - Filters

apply_filters( 'caldera_magic_tag', $filterd_tag, $original_tag );
apply_filters( 'caldera_magic_tag-my_tag', $filterd_tag, $args_array );
echo $magic->do_magic_tag('An example of {my_tag:argument}');