Plugin Directory

Changeset 1457850


Ignore:
Timestamp:
07/20/2016 11:02:36 PM (10 years ago)
Author:
plutonwp
Message:

new version

Location:
pluton-panel
Files:
55 added
7 edited

Legend:

Unmodified
Added
Removed
  • pluton-panel/trunk/includes/metabox/metabox.php

    r1443798 r1457850  
    578578                    ),
    579579                ),
    580                 'disable_social' => array(
    581                     'title' => esc_html__( 'Social Share', 'pluton-panel' ),
    582                     'id' => $prefix . 'disable_social',
    583                     'type' => 'select',
    584                     'description' => esc_html__( 'Enable or disable this element on this page or post.', 'pluton-panel' ),
    585                     'options' => array(
    586                         '' => esc_html__( 'Default', 'pluton-panel' ),
    587                         'enable' => esc_html__( 'Enable', 'pluton-panel' ),
    588                         'on' => esc_html__( 'Disable', 'pluton-panel' ),
    589                     ),
    590                 ),
    591580            ),
    592581        );
  • pluton-panel/trunk/includes/panel/extensions.php

    r1443798 r1457850  
    111111            'name'  => 'Custom Sidebar',
    112112            'desc'  => 'Create an unlimited number of sidebars and assign unlimited number of widgets.',
     113        );
     114
     115        $free['social-sharing'] = array(
     116            'url'   => 'https://plutonwp.com/extension/pluton-social-sharing/',
     117            'image' => plugins_url( '/assets/img/social-share-image.png', __FILE__ ),
     118            'name'  => 'Social Sharing',
     119            'desc'  => 'Add social share buttons to your single posts with this free extension.',
    113120        );
    114121
  • pluton-panel/trunk/includes/panel/theme-panel.php

    r1447852 r1457850  
    1313}
    1414
    15 // Global class
    16 $pluton_theme_panel;
    17 
    1815// Start Class
    1916if ( ! class_exists( 'Pluton_Theme_Panel' ) ) {
     
    2724        public function __construct() {
    2825
    29             // Array of theme "parts/addons" that can be enabled/disabled
    30             $this->theme_addons = apply_filters( 'pluton_theme_addons', array(
     26            // Add panel menu
     27            add_action( 'admin_menu', array( 'Pluton_Theme_Panel', 'add_menu_page' ), 0 );
     28
     29            // Add panel submenu
     30            add_action( 'admin_menu', array( 'Pluton_Theme_Panel', 'add_menu_subpage' ) );
     31
     32            // Add custom CSS for the theme panel
     33            add_action( 'admin_print_styles-toplevel_page_pluton-panel', array( 'Pluton_Theme_Panel','css' ) );
     34
     35            // Register panel settings
     36            add_action( 'admin_init', array( 'Pluton_Theme_Panel','register_settings' ) );
     37
     38            // Load addon files
     39            self::load_addons();
     40
     41        }
     42
     43        /**
     44         * Return theme addons
     45         * Can't be added in construct because translations won't work
     46         *
     47         * @since 1.0.8
     48         */
     49        private static function get_addons() {
     50            $addons = array(
    3151                'schema_markup' => array(
    3252                    'label'     => esc_html__( 'Schema Markup', 'pluton-panel' ),
     
    87107                    'category'  => esc_html__( 'Optimizations', 'pluton-panel' ),
    88108                ),
    89             ) );
    90 
    91             // Add panel menu
    92             add_action( 'admin_menu', array( $this, 'add_menu_page' ), 0 );
    93 
    94             // Add panel submenu
    95             add_action( 'admin_menu', array( $this, 'add_menu_subpage' ) );
    96 
    97             // Add custom CSS for the theme panel
    98             add_action( 'admin_print_styles-toplevel_page_pluton-panel', array( $this,'css' ) );
    99 
    100             // Register panel settings
    101             add_action( 'admin_init', array( $this,'register_settings' ) );
    102 
    103             // Load addon files
    104             $this->load_addons();
     109            );
     110
     111            // Apply filters and return
     112            return apply_filters( 'pluton_theme_addons', $addons );
    105113
    106114        }
     
    111119         * @since 1.0.0
    112120         */
    113         public function add_menu_page() {
     121        public static function add_menu_page() {
    114122          add_menu_page(
    115123                esc_html__( 'Theme Panel', 'pluton-panel' ),
     
    128136         * @since 1.0.0
    129137         */
    130         public function add_menu_subpage(){
     138        public static function add_menu_subpage(){
    131139            add_submenu_page(
    132140                'pluton-general',
     
    135143                'manage_options',
    136144                'pluton-panel',
    137                 array( $this, 'create_admin_page' )
     145                array( 'Pluton_Theme_Panel', 'create_admin_page' )
    138146            );
    139147        }
     
    144152         * @since 1.0.0
    145153         */
    146         public function register_settings() {
    147             register_setting( 'pluton_tweaks', 'pluton_tweaks', array( $this, 'admin_sanitize' ) );
    148             register_setting( 'pluton_options', 'pluton_options', array( $this, 'admin_sanitize_license_options' ) );
     154        public static function register_settings() {
     155            register_setting( 'pluton_tweaks', 'pluton_tweaks', array( 'Pluton_Theme_Panel', 'admin_sanitize' ) );
     156            register_setting( 'pluton_options', 'pluton_options', array( 'Pluton_Theme_Panel', 'admin_sanitize_license_options' ) );
    149157        }
    150158
     
    154162         * @since 1.0.0
    155163         */
    156         public function admin_sanitize_license_options( $input ) {
     164        public static function admin_sanitize_license_options( $input ) {
    157165   
    158166            //filter to save all settings to database
     
    165173         * @since 1.0.0
    166174         */
    167         public function admin_sanitize( $options ) {
     175        public static function admin_sanitize( $options ) {
    168176
    169177            // Check options first
     
    172180            }
    173181
     182            // Get addons array
     183            $theme_addons = self::get_addons();
     184
    174185            // Save checkboxes
    175186            $checkboxes = array();
    176187
    177188            // Add theme parts to checkboxes
    178             foreach ( $this->theme_addons as $key => $val ) {
     189            foreach ( $theme_addons as $key => $val ) {
    179190
    180191                // Get correct ID
     
    225236         * @since 1.0.0
    226237         */
    227         public function create_admin_page() { ?>
     238        public static function create_admin_page() {
     239
     240            // Get addons array
     241            $theme_addons = self::get_addons(); ?>
    228242
    229243            <div class="wrap pluton-theme-panel pluton-clr">
     
    329343                        <?php
    330344                        // Categories
    331                         $categories = wp_list_pluck( $this->theme_addons, 'category' );
     345                        $categories = wp_list_pluck( $theme_addons, 'category' );
    332346                        $categories = array_unique( $categories );
    333347                        asort( $categories ); ?>
     
    340354                                // Check condition
    341355                                $display = true;
    342                                 if ( isset( $this->theme_addons[$key]['condition'] ) ) {
    343                                     $display = $this->theme_addons[$key]['condition'];
     356                                if ( isset( $theme_addons[$key]['condition'] ) ) {
     357                                    $display = $theme_addons[$key]['condition'];
    344358                                }
    345359
     
    364378                                $count = 0;
    365379                                // Loop through theme pars and add checkboxes
    366                                 foreach ( $this->theme_addons as $key => $val ) :
     380                                foreach ( $theme_addons as $key => $val ) :
    367381                                    $count++;
    368382
     
    391405
    392406                                    // Get theme option
    393                                     $theme_mod = pluton_get_mod( $key, $default );
     407                                    $theme_mod = get_theme_mod( $key, $default );
    394408
    395409                                    // Get category and sanitize
     
    523537            $dir = PP_ROOT .'/includes/panel/';
    524538
     539            // Image Sizes
     540            if ( get_theme_mod( 'image_sizes_enable', true ) ) {
     541                require_once( $dir .'image-sizes.php' );
     542            }
     543
    525544            // Typography
    526             if ( pluton_get_mod( 'typography_enable', true ) ) {
     545            if ( get_theme_mod( 'typography_enable', true ) ) {
    527546                require_once( $dir .'typography.php' );
    528547            }
    529548
    530549            // Custom 404
    531             if ( pluton_get_mod( 'custom_404_enable', true ) ) {
     550            if ( get_theme_mod( 'custom_404_enable', true ) ) {
    532551                require_once( $dir .'custom-404.php' );
    533552            }
    534553
     554            // Customizer Manager
     555            if ( get_theme_mod( 'customizer_panel_enable', true ) ) {
     556                require_once( $dir .'customizer.php' );
     557            }
     558
    535559            // Custom WordPress gallery output
    536             if ( pluton_get_mod( 'custom_wp_gallery_enable', true ) ) {
     560            if ( get_theme_mod( 'custom_wp_gallery_enable', true ) ) {
    537561                require_once( $dir .'wp-gallery.php' );
    538562            }
    539563
    540564            // Custom CSS
    541             if ( pluton_get_mod( 'custom_css_enable', true ) ) {
     565            if ( get_theme_mod( 'custom_css_enable', true ) ) {
    542566                require_once( $dir .'custom-css.php' );
    543567            }
    544568
    545569            // Custom JS
    546             if ( pluton_get_mod( 'custom_js_enable', false ) ) {
     570            if ( get_theme_mod( 'custom_js_enable', false ) ) {
    547571                require_once( $dir .'custom-js.php' );
    548572            }
    549573
    550574            // Import Export Functions
    551             if ( is_admin() && pluton_get_mod( 'import_export_enable', true ) ) {
     575            if ( is_admin() && get_theme_mod( 'import_export_enable', true ) ) {
    552576                require_once( $dir .'import-export.php' );
    553577            }
     
    634658    }
    635659}
    636 $pluton_theme_panel = new Pluton_Theme_Panel();
     660new Pluton_Theme_Panel();
  • pluton-panel/trunk/includes/panel/typography.php

    r1448206 r1457850  
    4040
    4141            // Load Google Font scripts
    42             if ( pluton_get_mod( 'google_fonts_in_footer' ) ) {
     42            if ( get_theme_mod( 'google_fonts_in_footer' ) ) {
    4343                add_action( 'wp_footer', array( $this, 'load_fonts' ) );
    4444            } else {
     
    501501                // Get target and current mod
    502502                $target  = isset( $array['target'] ) ? $array['target'] : '';
    503                 $get_mod = pluton_get_mod( $element .'_typography' );
     503                $get_mod = get_theme_mod( $element .'_typography' );
    504504
    505505                // Attributes to loop through
     
    706706                    continue;
    707707                }
    708                 $subset = pluton_get_mod( 'google_font_subsets', 'latin' );
     708                $subset = get_theme_mod( 'google_font_subsets', 'latin' );
    709709                $subset = $subset ? $subset : 'latin';
    710710                $subset = '&amp;subset='. $subset;
  • pluton-panel/trunk/includes/panel/wp-gallery.php

    r1443798 r1457850  
    136136            // Set cropping sizes
    137137            if ( $columns > 1 ) {
    138                 $img_width  = $img_width ? $img_width : pluton_get_mod( 'gallery_image_width' );
    139                 $img_height = $img_height ? $img_height : pluton_get_mod( 'gallery_image_height' );
     138                $img_width  = $img_width ? $img_width : get_theme_mod( 'gallery_image_width' );
     139                $img_height = $img_height ? $img_height : get_theme_mod( 'gallery_image_height' );
    140140            }
    141141
  • pluton-panel/trunk/pluton-panel.php

    r1448206 r1457850  
    44 * Plugin URI:          https://plutonwp.com/extension/pluton-panel/
    55 * Description:         Add meta boxes for your posts, pages, posts types and Theme Panel to extend the functionality of the theme.
    6  * Version:             1.0.3
     6 * Version:             1.0.4
    77 * Author:              PlutonWP
    88 * Author URI:          https://plutonwp.com/
     
    8787        $this->plugin_url       = plugin_dir_url( __FILE__ );
    8888        $this->plugin_path      = plugin_dir_path( __FILE__ );
    89         $this->version          = '1.0.3';
     89        $this->version          = '1.0.4';
    9090
    9191        define( 'PP_ROOT', dirname( __FILE__ ) );
  • pluton-panel/trunk/readme.txt

    r1448206 r1457850  
    44Requires at least: 3.5
    55Tested up to: 4.5.3
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3434== Changelog ==
    3535
     36= 1.0.4 =
     37Image Sizes & Customizer Manager tabs added.
     38
    3639= 1.0.3 =
    3740Small problem with the customizer fixed.
Note: See TracChangeset for help on using the changeset viewer.