Plugin Directory

Changeset 2015957


Ignore:
Timestamp:
01/20/2019 08:35:25 PM (7 years ago)
Author:
codemonkeyssoftware
Message:

Base templating system in place; ready to start adding in checkout

Location:
generosity
Files:
316 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • generosity/trunk/generosity.php

    r2014576 r2015957  
    66 * Author: Code Monkeys Software
    77 * Author URI: http://codemonkeyssoftware.com
    8  * Version: 0.0.3
     8 * Version: 0.0.4
    99 * Text Domain: generosity
    1010 * Domain Path: languages
     
    5858         * @uses    Generosity::load_textdomain() load the language files
    5959         * @see     Generosity()
    60          * @return The one true Generosity
     60         * @return Generosity
    6161         */
    6262        public static function instance() {
     
    6565                self::$instance->setup_constants();
    6666
    67 
    6867                add_action('plugins_loaded', array(self::$instance, 'load_textdomain'));
    6968
     
    154153            require_once GENEROSITY_PLUGIN_DIR . 'includes/scripts.php';
    155154            require_once GENEROSITY_PLUGIN_DIR . 'includes/class-generosity-roles.php';
     155            require_once GENEROSITY_PLUGIN_DIR . 'includes/class-generosity-template-loader.php';
     156            require_once GENEROSITY_PLUGIN_DIR . 'includes/template-functions.php';
     157            require_once GENEROSITY_PLUGIN_DIR . 'includes/checkout.php';
     158
    156159
    157160            if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
  • generosity/trunk/includes/admin/register-settings.php

    r2014575 r2015957  
    4848        // Customize CMB2 URL
    4949        add_filter('cmb2_meta_box_url', array($this, 'generosity_update_cmb_meta_box_url'));
    50 
    51         // Custom Field Types
    52 
    5350
    5451    }
     
    141138
    142139    <?php
    143     }
    144 
    145     /**
    146      * Public getter method for retrieving protected/private variables
    147      *
    148      * @since 0.0.2
    149      *
    150      * @param string $field Field to retrieve
    151      *
    152      * @return mixed Field value or exception is thrown
    153      */
    154     public function __get($field) {
    155 
    156         // Allowed fields to retrieve
    157         if (in_array($field, array('key', 'fields', 'title', 'options_page'), true)) {
    158             return $this->{$field};
    159         }
    160         if ('option_metabox' === $field) {
    161             return $this->option_metabox();
    162         }
    163 
    164         throw new Exception('Invalid property: ' . $field);
    165140    }
    166141
     
    231206
    232207
     208    /**
     209     * Public getter method for retrieving protected/private variables
     210     *
     211     * @since 0.0.4
     212     *
     213     * @param string $field Field to retrieve
     214     *
     215     * @return mixed Field value or exception is thrown
     216     */
     217    public function __get($field) {
     218        echo "<pre>";
     219        var_dump('here');
     220        echo "</pre>";
     221        // Allowed fields to retrieve
     222        if (in_array($field, array('key', 'fields', 'title', 'options_page'), true)) {
     223            return $this->{$field};
     224        }
     225        if ('option_metabox' === $field) {
     226            return $this->option_metabox();
     227        }
     228
     229        throw new Exception('Invalid property: ' . $field);
     230    }
     231
     232
    233233}
    234234
  • generosity/trunk/includes/post-types.php

    r2013821 r2015957  
    272272
    273273add_filter('post_updated_messages', 'generosity_updated_messages');
     274
     275
     276/**
     277 * Setup Post Type Images
     278 */
     279add_action('after_setup_theme', 'generosity_add_thumbnail_support', 10);
     280add_action('after_setup_theme', 'generosity_add_image_sizes', 10);
     281
     282/**
     283 * Ensure post thumbnail support is turned on
     284 */
     285function generosity_add_thumbnail_support() {
     286    if (!current_theme_supports('post-thumbnails')) {
     287        add_theme_support('post-thumbnails');
     288    }
     289    add_post_type_support('generosity_forms', 'thumbnail');
     290}
     291
     292/**
     293 * Add Generosity Image sizes to WP
     294 *
     295 * @since 0.0.4
     296 */
     297function generosity_add_image_sizes() {
     298    $generosity_form_thumbnail = generosity_get_image_size('geenerosity_form_thumbnail');
     299    $generosity_form_single = generosity_get_image_size('generosity_form_single');
     300
     301    add_image_size('generosity_form_thumbnail', $generosity_form_thumbnail['width'], $generosity_form_thumbnail['height'], $generosity_form_thumbnail['crop']);
     302    add_image_size('generosity_form_single', $generosity_form_single['width'], $generosity_form_single['height'], $generosity_form_single['crop']);
     303}
  • generosity/trunk/readme.txt

    r2014576 r2015957  
    4343== Changelog ==
    4444
     45= 0.0.4 =
     46* Base templating system in place; ready to start adding in checkout
     47
    4548= 0.0.3 =
    4649* Base form custom fields setup, ready to start building in templating system.
Note: See TracChangeset for help on using the changeset viewer.