Plugin Directory

Changeset 718549


Ignore:
Timestamp:
05/26/2013 08:29:11 PM (13 years ago)
Author:
borgboy
Message:

Added support for hoome page and fixed minor bugs

Location:
article-forge/trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • article-forge/trunk/ArticleForge.php

    r718377 r718549  
    222222            remove_filter('template_redirect', 'redirect_canonical');
    223223        }
    224         return $wp_query->is_404();
     224        return !$wp_query->is_404();
     225    }
     226
     227    public function home($wp_query) {
     228        if ( $this->options->show_on_home == 'true' ) {
     229            $wp_query->set('post_type', af_namespace() . '_' . ArticleForge\Constants::SummaryPostType);
     230            //$wp_query->is_post_type_archive = true;
     231            //$wp_query->is_archive = true;
     232        }
    225233    }
    226234
  • article-forge/trunk/ArticleForge/Admin/Settings.php

    r718381 r718549  
    104104                        'args' => array()
    105105                    ),
     106                    array(
     107                        'name' => 'show_on_home',
     108                        'title' => __( 'Home page', 'articleforge' ),
     109                        'callback' => array( $this, 'show_on_home_field' ),
     110                        'sanitize_callback' => array( ),
     111                        'args' => array()
     112                    ),
    106113                ) // fields
    107114            ), // theme section
     
    270277        $options['prefix_list_slug'] = $options['prefix_list_slug'] == 'true' ? 'true' : 'false';
    271278        $options['enable_revisions'] = $options['enable_revisions'] == 'true' ? 'true' : 'false';
     279        $options['show_on_home'] = $options['show_on_home'] == 'true' ? 'true' : 'false';
    272280
    273281        // report errors
     
    363371?>
    364372
    365     <input name="<?php echo af_namespace(); ?>_options[enable_revisions]" type="checkbox" id="_<?php echo af_namespace(); ?>_enable_revisions" value="true" <?php echo $this->options->prefix_list_slug == 'true' ? 'checked="checked"' : '' ?>/><label for="_<?php echo af_namespace(); ?>_enable_revisions"> Enable revisions for Article Summaries and Content</label>
     373    <input name="<?php echo af_namespace(); ?>_options[enable_revisions]" type="checkbox" id="_<?php echo af_namespace(); ?>_enable_revisions" value="true" <?php echo $this->options->enable_revisions == 'true' ? 'checked="checked"' : '' ?>/><label for="_<?php echo af_namespace(); ?>_enable_revisions"> Enable revisions for Article Summaries and Content</label>
     374
     375<?php
     376}
     377
     378public function show_on_home_field() {
     379?>
     380
     381    <input name="<?php echo af_namespace(); ?>_options[show_on_home]" type="checkbox" id="_<?php echo af_namespace(); ?>_show_on_home" value="true" <?php echo $this->options->show_on_home == 'true' ? 'checked="checked"' : '' ?>/><label for="_<?php echo af_namespace(); ?>_show_on_home"> Display Articles on home page</label>
    366382
    367383<?php
  • article-forge/trunk/ArticleForge/Constants.php

    r718381 r718549  
    66    const PackageName     = 'Article Forge';
    77
    8     const Version         = '1.0.1';
     8    const Version         = '1.0.2';
    99
    1010    const PackagePrefix   = 'articleforge';
  • article-forge/trunk/ArticleForge/Content/ActionMap.php

    r718377 r718549  
    4040
    4141        if (!articleforge()->validate_request($wp_query)) return;
    42 //      global $wp_query;
    43 //      articleforge_debug('pgp', $query);
    44 //      $wp_query->set_404();
    45 
     42        if ( is_home() ) articleforge()->home($wp_query);
    4643        // (bool)$query->get('is_archive')
    4744        if ( is_post_type_archive() && is_post_type_namespace(af_namespace())) {
  • article-forge/trunk/ArticleForge/Options.php

    r718377 r718549  
    3939        //'[allow]_nested/heirarchical_comments',
    4040        'summaries_per_page' => 5,
    41         'enable_revisions' => 'true'
     41        'enable_revisions' => 'true',
     42        'show_on_home' => 'false'
    4243        //'anonymous_comments'
    4344    );
  • article-forge/trunk/functions.php

    r718377 r718549  
    99 * $Id$
    1010 *
    11  * @package Article Forge
     11 * @package ArticleForge
    1212 *
    1313 */
     
    5050    else if (is_single()) return 'single';
    5151    else if (is_post_type_archive()) return 'archive';
     52    else if (is_home()) return 'home';
    5253}
    5354
  • article-forge/trunk/main.php

    r718381 r718549  
    77 * Author:      Anthony Wells
    88 * Author URI:  http://www.bytewisemcu.org/profile/awells
    9  * Version:     1.0.1
     9 * Version:     1.0.2
    1010 * Text Domain: articleforge
    1111 * Domain Path: /languages/
  • article-forge/trunk/readme.txt

    r718381 r718549  
    44Requires at least: 3.0.1
    55Tested up to: 3.5.1
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5858== Changelog ==
    5959
     60= 1.0.2 =
     61* Added home page support
     62* Fixed time of load of Options in Setting module
     63
    6064= 1.0 =
    6165* Official release!
Note: See TracChangeset for help on using the changeset viewer.