Plugin Directory

Changeset 984612


Ignore:
Timestamp:
09/08/2014 06:39:28 PM (12 years ago)
Author:
chriswallace
Message:

Cleaned up the main plugin file a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freefolio/trunk/freefolio.php

    r984597 r984612  
    3030}
    3131
     32/**
     33 * Set up plugin constants
     34 */
    3235define( 'DPI__PLUGIN_DIR',    plugin_dir_path( __FILE__ ) );
    3336define( 'DPI__PLUGIN_FILE',   __FILE__ );
    3437
    35 require_once( DPI__PLUGIN_DIR . 'class.DP_Importer.php' );
     38/**
     39 * Add localization to the FreeFolio plugin.
     40 */
     41function freefolio_localize(){
    3642
    37 register_activation_hook( DPI__PLUGIN_FILE, array( 'DP_Importer', 'on_plugin_activation' ) );
    38 register_deactivation_hook( DPI__PLUGIN_FILE, array( 'DP_Importer', 'on_plugin_deactivation' ) );
     43    load_plugin_textdomain( 'freefolio', false, basename( dirname( __FILE__ ) ) . '/languages' );
     44
     45}
     46add_action( 'plugins_loaded', 'freefolio_localize' );
     47
     48/**
     49 * Dribbble Importer setup
     50 */
     51if( is_admin() ){
     52
     53    require_once( DPI__PLUGIN_DIR . 'class.DP_Importer.php' );
     54
     55    register_activation_hook( DPI__PLUGIN_FILE, array( 'DP_Importer', 'on_plugin_activation' ) );
     56    register_deactivation_hook( DPI__PLUGIN_FILE, array( 'DP_Importer', 'on_plugin_deactivation' ) );
     57
     58}
    3959
    4060add_action( 'init', array( 'DP_Importer', 'init' ) );
Note: See TracChangeset for help on using the changeset viewer.