Plugin Directory

Changeset 683363


Ignore:
Timestamp:
03/17/2013 07:12:36 PM (13 years ago)
Author:
maxrice
Message:

Fix TipTips and add new filters for customizing tab titles

Location:
woocommerce-customizer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-customizer/trunk/admin/class-wc-customizer-admin.php

    r610839 r683363  
    3131    public static function init() {
    3232
    33         self::$tabs = array( 'shop_loop'        => __( 'Shop Loop', WC_Customizer::$text_domain ),
    34                                                  'product_page'    => __( 'Product Page', WC_Customizer::$text_domain ),
    35                                                  'checkout'         => __( 'Checkout', WC_Customizer::$text_domain ),
    36                                                  'misc'             => __( 'Misc', WC_Customizer::$text_domain )
     33        self::$tabs = array( 'shop_loop'    => __( 'Shop Loop', WC_Customizer::$text_domain ),
     34                             'product_page' => __( 'Product Page', WC_Customizer::$text_domain ),
     35                             'checkout'     => __( 'Checkout', WC_Customizer::$text_domain ),
     36                             'misc'         => __( 'Misc', WC_Customizer::$text_domain )
    3737        );
    3838
    39         // Load necessary admin styles / scripts
    40         add_action( 'admin_enqueue_scripts', __CLASS__ . '::load_styles_scripts' );
     39        // Add settings page screen ID to list of pages for WC CSS/JS to load on
     40        add_filter( 'woocommerce_screen_ids', array( __CLASS__, 'load_woocommerce_styles_scripts' ) );
    4141
    4242        // Add 'Customizer' link under WooCommerce menu
    43         add_action( 'admin_menu', __CLASS__ . '::add_menu_link' );
    44 
    45     }
    46 
    47     /**
    48      * Load admin styles and scripts, only on our page
    49      *
    50      * @access public
    51      * @since  1.0
    52      * @param $hook_suffix
    53      * @return void
    54      */
    55     public static function load_styles_scripts( $hook_suffix ) {
    56         global $woocommerce;
    57 
    58         // only load on our settings page
    59         if ( $hook_suffix != self::$page )
    60             return;
    61 
    62         // WooCommerce styles
    63         wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css' );
    64 
    65         // WooCommerce Admin JS for tool tips
    66         wp_enqueue_script( 'woocommerce_admin', $woocommerce->plugin_url() . '/assets/js/admin/woocommerce_admin.min.js', array( 'jquery', 'jquery-ui-widget', 'jquery-ui-core' ), $woocommerce->version );
    67 
    68     }
     43        add_action( 'admin_menu', array( __CLASS__, 'add_menu_link' ) );
     44
     45    }
     46
     47
     48    /**
     49     * Add Customizer settings screen ID to the list of pages for WC to load CSS/JS on
     50     *
     51     * @since  1.0
     52     * @param array $screen_ids
     53     * @return array
     54     */
     55    public static function load_woocommerce_styles_scripts( $screen_ids ) {
     56
     57        $screen_ids[] = 'woocommerce_page_woocommerce_customizer';
     58
     59        return $screen_ids;
     60    }
     61
    6962
    7063    /**
     
    177170
    178171            if ( $field['desc_tip'] === true ) {
    179                 $description = '<img class="help_tip" data-tip="' . esc_attr( $field['desc'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
     172                $description = '<img height="16" width="16" class="help_tip" data-tip="' . esc_attr( $field['desc'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
    180173            } elseif ( $field['desc_tip'] ) {
    181                 $description = '<img class="help_tip" data-tip="' . esc_attr( $field['desc_tip'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
     174                $description = '<img height="16" width="16" class="help_tip" data-tip="' . esc_attr( $field['desc_tip'] ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" />';
    182175            } else {
    183176                $description = '<span class="description">' . $field['desc'] . '</span>';
     
    347340
    348341            array(
    349                 // tab title customization coming in wc 1.7
    350                 /*array(
    351                                                         'name'      => __( 'Tab Titles', WC_Customizer::$text_domain ),
    352                                                         'type'      => 'title'
    353                                                     ),
    354 
    355                                                     array(
    356                                                         'filter_id'     => 'woocommerce_product_description_tab_title',
    357                                                         'name'              => __( 'Product Description', WC_Customizer::$text_domain ),
    358                                                         'desc_tip'      => __( 'Changes the Production Description tab title', WC_Customizer::$text_domain ),
    359                                                         'type'              => 'text'
    360                                                     ),
    361 
    362                                                     array(
    363                                                         'filter_id'     => 'woocommerce_product_additional_information_tab_title',
    364                                                         'name'              => __( 'Additional Information', WC_Customizer::$text_domain ),
    365                                                         'desc_tip'      => __( 'Changes the Additional Information tab title', WC_Customizer::$text_domain ),
    366                                                         'type'              => 'text'
    367                                                     ),
    368 
    369                                                     array(
    370                                                         'filter_id'     => 'woocommerce_reviews_tab_title',
    371                                                         'name'              => __( 'Reviews', WC_Customizer::$text_domain ),
    372                                                         'desc_tip'      => __( 'Changes the Reviews tab title', WC_Customizer::$text_domain ),
    373                                                         'type'              => 'text'
    374                                                     ),
    375 
    376                                                     array( 'type' => 'sectionend' ),*/
    377 
    378                 array(
    379                     'name'    => __( 'Tab Headings', WC_Customizer::$text_domain ),
     342
     343                array(
     344                    'name'      => __( 'Tab Titles', WC_Customizer::$text_domain ),
     345                    'type'      => 'title'
     346                ),
     347
     348                array(
     349                    'filter_id'     => 'woocommerce_product_description_tab_title',
     350                    'name'              => __( 'Product Description', WC_Customizer::$text_domain ),
     351                    'desc_tip'      => __( 'Changes the Production Description tab title', WC_Customizer::$text_domain ),
     352                    'type'              => 'text'
     353                ),
     354
     355                array(
     356                    'filter_id'     => 'woocommerce_product_additional_information_tab_title',
     357                    'name'              => __( 'Additional Information', WC_Customizer::$text_domain ),
     358                    'desc_tip'      => __( 'Changes the Additional Information tab title', WC_Customizer::$text_domain ),
     359                    'type'              => 'text'
     360                ),
     361
     362                array( 'type' => 'sectionend' ),
     363
     364                array(
     365                    'name'    => __( 'Tab Content Headings', WC_Customizer::$text_domain ),
    380366                    'type'    => 'title'
    381367                ),
  • woocommerce-customizer/trunk/readme.txt

    r610839 r683363  
    33Donate link: http://www.maxrice.com
    44Tags: woocommerce
    5 Requires at least: 3.3
    6 Tested up to: 3.4.2
    7 Stable tag: 1.0
     5Requires at least: 3.5.1
     6Tested up to: 3.5.1
     7Stable tag: 1.0.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5454== Changelog ==
    5555
     56= 1.0.1 =
     57* Add two new filters for customizing the Product Description and Additional Information tab titles
     58* Fix TipTips on Customizer page
     59
    5660= 1.0 =
    5761* Initial release
  • woocommerce-customizer/trunk/woocommerce-customizer.php

    r610839 r683363  
    44 * Plugin URI: http://www.maxrice.com/wordpress/woocommerce-customizer/
    55 * Description: Helps you customize WooCommerce without writing any code
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Author: Max Rice
    88 * Author URI: http://www.maxrice.com
     
    1414 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1515 *
    16  * @package    WooCommerce Customizer
     16 * @package    WooCommerce-Customizer
    1717 * @author     Max Rice
    1818 * @since      1.0
Note: See TracChangeset for help on using the changeset viewer.