Plugin Directory

Changeset 1672335


Ignore:
Timestamp:
06/07/2017 08:25:23 AM (9 years ago)
Author:
garrettboatman
Message:

Push trunk for fixed plugin

Location:
booklaunch/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • booklaunch/trunk/booklaunch.php

    r1126672 r1672335  
    44   Plugin URI: https://booklaunch.io
    55   Description: A plugin that integrates your Booklaunch page as a page template on your Wordpress website.
    6    Version: 1.0.4
     6   Version: 1.0.5
    77   Author: The Booklaunch Team
    88   Author URI: https://booklaunch.io
     
    2626
    2727    }
    28 
     28   
    2929    /**
    3030     * Initializes the plugin by setting filters and administration functions.
     
    3434        $this->templates = array();
    3535
    36 
    37         // Adds a filter to the attributes metabox to inject template into the cache.
    38         add_filter(
    39             'page_attributes_dropdown_pages_args',
    40              array( $this, 'register_booklaunch_templates' )
    41         );
    42 
     36        // Add a filter to the attributes metabox to inject template into the cache.
     37        if ( version_compare( floatval( get_bloginfo( 'version' ) ), '4.7', '<' ) ) {
     38
     39            // 4.6 and older
     40            add_filter(
     41                'page_attributes_dropdown_pages_args',
     42                array( $this, 'register_booklaunch_templates' )
     43            );
     44
     45        } else {
     46
     47            // Add a filter to the wp 4.7 version attributes metabox
     48            add_filter(
     49                'theme_page_templates', array( $this, 'add_new_template' )
     50            );
     51
     52        }
    4353
    4454        // Adds  filter to the save post to inject out template into the page cache
     
    6171    }
    6272
     73    /**
     74     * Adds our template to the page dropdown for v4.7+
     75     *
     76     */
     77    public function add_new_template( $posts_templates ) {
     78        $posts_templates = array_merge( $posts_templates, $this->templates );
     79        return $posts_templates;
     80    }
    6381
    6482    /**
  • booklaunch/trunk/readme.txt

    r1126672 r1672335  
    44Tags: booklaunch
    55Requires at least: 3.0
    6 Tested up to: 4.1
    7 Stable tag: 1.0.4
     6Tested up to: 4.7.5
     7Stable tag: 1.0.5
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5757* Make sure the Booklaunch Options are toggled on in the editor's "Screen Options" tab.
    5858
     59= Why don't I see "Booklaunch Page" dropdown? =
     60
     61Make sure to update your Booklaunch plugin from the Wordpress dashboard. Wordpress 4.7+ is not compatible with old versions of this plugin.
     62
    5963== Changelog ==
     64
     65
     66= 1.0.5 =
     67* Plugin now works with Wordpress 4.7+
    6068
    6169= 1.0.4 =
Note: See TracChangeset for help on using the changeset viewer.