Plugin Directory

Changeset 1105291


Ignore:
Timestamp:
03/04/2015 05:44:02 PM (11 years ago)
Author:
mpvanwinkle77
Message:

Preparing for 1.2.0-beta release

Location:
twigify/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • twigify/trunk/lib/ContentTemplates/Query.php

    r1058659 r1105291  
    88    global $wpdb;
    99    $foundposts = new WP_Query($query_string);
    10     //print_r($foundposts->query_vars);
    1110    if ( $foundposts->have_posts() ) {
    1211      return $foundposts->get_posts();
  • twigify/trunk/lib/ContentTemplates/User.php

    r1091590 r1105291  
    99  public $user;
    1010
    11   public function field($field = "*") {
     11  public function __construct() {
    1212    if (!$this->user) {
    1313      $this->user = wp_get_current_user();
    1414    }
     15  }
     16
     17  public function field($field = "*") {
    1518    if ($field === "*") {
    1619      echo "<pre>";
     
    2225    return false;
    2326  }
     27
     28  public function meta($key, $single=true) {
     29    return get_user_meta($this->user->ID, $key, $single);
     30  }
    2431 
    2532}
  • twigify/trunk/lib/ContentTemplates/View.php

    r1058659 r1105291  
    44use \ContentTemplates\Rules;
    55use \ContentTemplatesPlugin as Plugin;
     6use \ContentTemplates\Terms;
     7use \ContentTemplates\Post;
     8use \ContentTemplates\Functions;
     9use \ContentTemplates\User;
    610use \Twig_Autoloader,
    711  Twig_Loader_String,
    812  Twig_Loader_Filesystem,
    9   Twig_Environment;
    10 use \ContentTemplates\Terms;
    11 use \ContentTemplates\Post;
    12 use \ContentTemplates\Functions;
     13  Twig_Environment,
     14  Twig_SimpleFunction;
    1315
    1416class View {
     
    6062    $this->env->addGLobal( 'query', new Query() );
    6163    $this->env->addGlobal( 'function', new Functions() );
     64    $this->env->addFunction( new Twig_SimpleFunction( 'is_user_logged_in', function() { return is_user_logged_in(); } ) );
     65    $this->env->addFunction( new Twig_SimpleFunction( 'current_user_can', function($privilege) { return current_user_can($privilege); } ) );
     66    $this->env->addGlobal( 'user', new User() );
     67    $this->env->addGlobal( 'post', new Post() );
    6268  }
    6369
  • twigify/trunk/lib/meta-boxes.php

    r1043611 r1105291  
    3636
    3737    $meta_boxes['ct_post_metabox'] = array(
    38         'id'        => 'Content Template',
    39         'title'     => __( 'Content Template', 'content-templates' ),
     38        'id'        => 'Twigify Template',
     39        'title'     => __( 'Twigify Template', 'content-templates' ),
    4040        'desc'          => 'You can set up global rules under the Content Templates >> Rules menu, or override for this template here',
    4141        'pages'     => apply_filters("ct_available_post_types", $post_types),
     
    4646        'fields'    => array(
    4747            array(
    48                 'name'      => __( 'Override', 'cmb' ),
    49                 'desc'      => __( 'Override content template to use', 'cmb' ),
     48                'desc'      => __( 'Select template to use for this post/page.', 'cmb' ),
    5049                'id'        => "{$prefix}override_template",
    5150                'type'      => 'select',
  • twigify/trunk/readme.txt

    r1089532 r1105291  
    55Requires at least: 4.0.1
    66Tested up to: 4.1
    7 Stable tag: 1.1.2-beta
     7Stable tag: 1.2.0-beta
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6262= 1.1.2-beta =
    6363* lowercase self for compatibility with php 5.4
     64
     65= 1.2.0-beta =
     66* Adds global user/post capability. Also adds the is_user_logged_in() and current_user_can() functions. Cleans up some fields
  • twigify/trunk/twigify.php

    r1089532 r1105291  
    55    Description: Allows you to create content templates that will conditionally override the content of a post or page or customer post type
    66    Author: Mike Van Winkle
    7     Version: 1.1.2-beta
     7    Version: 1.2.0-beta
    88    Author URI: http://mikevanwinkle.com
    99    Text Domain: twigify
Note: See TracChangeset for help on using the changeset viewer.