/**
  * Add menu items
  */
 public function register_importers()
 {
     register_importer('wpclubmanager_player_csv', __('WPCM Players', 'wp-club-manager'), __('Import <strong>players</strong> to your club via a csv file.', 'wp-club-manager'), array($this, 'player_importer'));
     register_importer('wpclubmanager_staff_csv', __('WPCM Staff', 'wp-club-manager'), __('Import <strong>staff</strong> to your club via a csv file.', 'wp-club-manager'), array($this, 'staff_importer'));
     register_importer('wpclubmanager_club_csv', __('WPCM Clubs', 'wp-club-manager'), __('Import <strong>clubs</strong> via a csv file.', 'wp-club-manager'), array($this, 'club_importer'));
     register_importer('wpclubmanager_match_csv', __('WPCM Matches', 'wp-club-manager'), __('Import <strong>matches</strong> via a csv file.', 'wp-club-manager'), array($this, 'match_importer'));
 }
コード例 #2
1
ファイル: plugins-compat.php プロジェクト: Gordondalos/expert
 function lingotek_wordpress_importer_init()
 {
     $class = new ReflectionClass('WP_Import');
     load_plugin_textdomain('wordpress-importer', false, basename(dirname($class->getFileName())) . '/languages');
     $GLOBALS['wp_import'] = new Lingotek_WP_Import();
     register_importer('wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array($GLOBALS['wp_import'], 'dispatch'));
 }
コード例 #3
1
 /**
  * Add menu items
  */
 public function register_importers()
 {
     $importers = apply_filters('sportspress_importers', array('sp_event_csv' => array('name' => __('SportsPress Events (CSV)', 'sportspress'), 'description' => __('Import <strong>events</strong> from a csv file.', 'sportspress'), 'callback' => array($this, 'events_importer')), 'sp_team_csv' => array('name' => __('SportsPress Teams (CSV)', 'sportspress'), 'description' => __('Import <strong>teams</strong> from a csv file.', 'sportspress'), 'callback' => array($this, 'teams_importer')), 'sp_player_csv' => array('name' => __('SportsPress Players (CSV)', 'sportspress'), 'description' => __('Import <strong>players</strong> from a csv file.', 'sportspress'), 'callback' => array($this, 'players_importer')), 'sp_staff_csv' => array('name' => __('SportsPress Staff (CSV)', 'sportspress'), 'description' => __('Import <strong>staff</strong> from a csv file.', 'sportspress'), 'callback' => array($this, 'staff_importer'))));
     foreach ($importers as $id => $importer) {
         register_importer($id, $importer['name'], $importer['description'], $importer['callback']);
     }
 }
コード例 #4
1
 /**
  * Add menu items
  */
 public function register_importers()
 {
     register_importer('prosports_event_csv', __('ProSports Events (CSV)', 'prosports'), __('Import <strong>events</strong> from a csv file.', 'prosports'), array($this, 'events_importer'));
     register_importer('prosports_team_csv', __('ProSports Teams (CSV)', 'prosports'), __('Import <strong>teams</strong> from a csv file.', 'prosports'), array($this, 'teams_importer'));
     register_importer('prosports_player_csv', __('ProSports Players (CSV)', 'prosports'), __('Import <strong>players</strong> from a csv file.', 'prosports'), array($this, 'players_importer'));
     register_importer('prosports_staff_csv', __('ProSports Staff (CSV)', 'prosports'), __('Import <strong>staff</strong> from a csv file.', 'prosports'), array($this, 'staff_importer'));
 }
コード例 #5
1
 /**
  * Adds the plugin menu item
  */
 function addMenuItem()
 {
     // Define menu
     $this->_pageHook = register_importer('drupal2wordpress', __('Drupal 2 WordPress', 'drupal2wp'), __('Import <strong>users, posts, pages, comments, media, categories, and tags</strong> from a Drupal database.', 'drupal2wp'), array($this, 'init'));
     // Init the page view on load
     add_action('load-' . $this->_pageHook, array($this, 'init'));
 }
コード例 #6
1
ファイル: class-msp-importer.php プロジェクト: pab44/pab44
 public function admin_init()
 {
     $upload = wp_upload_dir();
     $this->upload_baseurl = $upload['baseurl'];
     $this->upload_basedir = $upload['basedir'];
     $this->process_export_request();
     register_importer('masterslider-importer', __('Master Slider', MSWP_TEXT_DOMAIN), __('Import sliders and images from a Master Slider export file.', MSWP_TEXT_DOMAIN), array($this, 'render_importer_page'));
 }
コード例 #7
1
 public function action_admin_init()
 {
     if (get_option(__CLASS__ . '-version') != $this->version) {
         flush_rewrite_rules();
         update_option(__CLASS__ . '-version', $this->version);
     }
     register_importer('pjw-groupme-importer', 'GroupMe Importer', 'Lets you import groupme group conversations into WordPress', array($this, 'importer_go'));
 }
コード例 #8
1
 static function register_importer()
 {
     if (!defined('WP_LOAD_IMPORTERS')) {
         return;
     }
     $intranet_import = new Intranet_Import();
     register_importer('intranet', 'Intraweb', __('Import Intranets to Wordpress', 'intranet-importer'), array($intranet_import, 'start'));
 }
コード例 #9
1
 /**
  * Add the importer to the Tools > Import menu
  */
 function register_importer()
 {
     /* Only register the importer if the current user can manage snippets */
     if (!defined('WP_LOAD_IMPORTERS') || !current_user_can(get_snippets_cap())) {
         return;
     }
     /* Register the Code Snippets importer with WordPress */
     register_importer('code-snippets', __('Code Snippets', 'code-snippets'), __('Import snippets from a code snippets export file', 'code-snippets'), array($this, 'render'));
 }
コード例 #10
1
function wpimportv2_init()
{
    /**
     * WordPress Importer object for registering the import callback
     * @global WP_Import $wp_import
     */
    $GLOBALS['wp_import_v2'] = new WP_Import();
    register_importer('wordpress-v2', 'WordPress (v2)', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array($GLOBALS['wp_import'], 'dispatch'));
}
コード例 #11
1
ファイル: tumblr-importer.php プロジェクト: unisexx/drtooth
/**
 * Tumblr Importer Initialisation routines
 *
 * @package WordPress
 * @subpackage Importer
 */
function tumblr_importer_init() {
	global $tumblr_import;
	load_plugin_textdomain( 'tumblr-importer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );

	$tumblr_import = new Tumblr_Import();
	register_importer('tumblr', __('Tumblr', 'tumblr-importer'), __('Import posts from a Tumblr blog.', 'tumblr-importer'), array ($tumblr_import, 'start'));
	if ( !defined('TUMBLR_MAX_IMPORT') )
		define ('TUMBLR_MAX_IMPORT', 20);
}
コード例 #12
0
ファイル: nav-menu-roles.php プロジェクト: dot2006/jobify
 /**
  * Register the Importer
  * the regular Importer skips post meta for the menu items
  *
  * @access private
  * @return void
  */
 function register_importer()
 {
     include_once plugin_dir_path(__FILE__) . 'inc/class.Nav_Menu_Roles_Import.php';
     // Register the new importer
     if (defined('WP_LOAD_IMPORTERS')) {
         // Register the custom importer we've created.
         $roles_import = new Nav_Menu_Roles_Import();
         register_importer('nav_menu_roles', __('Nav Menu Roles', 'nav-menu-roles'), sprintf(__('Import %snav menu roles%s and other menu item meta skipped by the default importer', 'nav-menu-roles'), '<strong>', '</strong>'), array($roles_import, 'dispatch'));
     }
 }
コード例 #13
0
ファイル: plugin.php プロジェクト: kucrut/WordPress-Importer
function wpimportv2_init()
{
    /**
     * WordPress Importer object for registering the import callback
     * @global WP_Import $wp_import
     */
    $GLOBALS['wxr_importer'] = new WXR_Import_UI();
    register_importer('wordpress', 'WordPress (v2)', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export (WXR) file.', 'wordpress-importer'), array($GLOBALS['wxr_importer'], 'dispatch'));
    add_action('load-importer-wordpress', array($GLOBALS['wxr_importer'], 'on_load'));
    add_action('wp_ajax_wxr-import', array($GLOBALS['wxr_importer'], 'stream_import'));
}
コード例 #14
0
 /**
  * Register the customer and order importers
  *
  * @since 3.0.0
  */
 public function register_importers()
 {
     register_importer('woocommerce_customer_csv', 'WooCommerce Customer (CSV)', __('Import <strong>customers</strong> to your store via a csv file.', 'woocommerce-csv-import-suite'), array($this, 'load_importer'));
     register_importer('woocommerce_order_csv', 'WooCommerce Order (CSV)', __('Import <strong>orders</strong> to your store via a csv file.', 'woocommerce-csv-import-suite'), array($this, 'load_importer'));
     register_importer('woocommerce_coupon_csv', 'WooCommerce Coupon (CSV)', __('Import <strong>coupons</strong> to your store via a csv file.', 'woocommerce-csv-import-suite'), array($this, 'load_importer'));
     // load importers early on action/POST requests, to support
     // `redirect after post` type pattern.
     // This allows processing action/POST requests before any output is sent to the
     // buffer and also using wp_redirect(). This, however, means that all the
     // importers _must_ use the `redirect after post` pattern.
     if (isset($_REQUEST['import']) && isset($_REQUEST['action'])) {
         $this->load_importer();
     }
 }
コード例 #15
0
 /**
  * Initialize the plugin
  */
 private function __construct()
 {
     // Load plugin text domain
     add_action('plugins_loaded', array($this, 'load_plugin_textdomain'));
     // Load scripts js and styles css
     add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
     // Add menu page
     add_action('admin_menu', array($this, 'add_menu_page'));
     // Function AJAX impot posts
     add_action('wp_ajax_import_posts', array($this, 'import_posts'));
     add_action('wp_ajax_nopriv_import_posts', array($this, 'import_posts'));
     // Load Importer API
     require_once ABSPATH . 'wp-admin/includes/import.php';
     $GLOBALS['wp_rest_import'] = new WP_API_JSON_Import();
     register_importer('wpapijsonimport', __('WP API JSON Import', 'wpapijson-import'), __('Import links in OPML format.', 'wpapijson-import'), array($GLOBALS['wp_rest_import'], 'dispatch'));
 }
コード例 #16
0
/**
 * Add the importer to the Tools > Import menu
 *
 * @since 1.6
 * @access private
 */
function code_snippets_register_importer()
{
    /* Only register the importer if the current user can manage snippets */
    if (defined('WP_LOAD_IMPORTERS') && current_user_can(get_snippets_cap())) {
        /* Load Importer API */
        require_once ABSPATH . 'wp-admin/includes/import.php';
        if (!class_exists('WP_Importer')) {
            $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
            if (file_exists($class_wp_importer)) {
                require_once $class_wp_importer;
            }
        }
        /* Register the Code Snippets importer with WordPress */
        register_importer('code-snippets', __('Code Snippets', 'code-snippets'), __('Import snippets from a code snippets export file', 'code-snippets'), 'code_snippets_render_import_menu');
    }
    add_action('load-importer-code-snippets', 'code_snippets_load_import_menu');
}
コード例 #17
0
    {
        $step = isset($_GET['step']) ? (int) $_GET['step'] : 1;
        $this->header();
        if (current_user_can('manage_categories')) {
            switch ($step) {
                case 1:
                    $this->categories_tab();
                    break;
                case 2:
                    check_admin_referer('import-cat2tag');
                    $this->convert_categories();
                    break;
                case 3:
                    $this->tags_tab();
                    break;
                case 4:
                    check_admin_referer('import-cat2tag');
                    $this->convert_tags();
                    break;
            }
        }
        $this->footer();
    }
    function WP_Categories_to_Tags()
    {
        // Do nothing.
    }
}
$wp_cat2tag_importer = new WP_Categories_to_Tags();
register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init'));
コード例 #18
0
 /**
  * funtion to register the coupon importer
  */
 public function woocommerce_coupon_admin_init()
 {
     global $wpdb;
     if (defined('WP_LOAD_IMPORTERS')) {
         register_importer('woocommerce_smart_coupon_csv', __('WooCommerce Coupons', self::$text_domain), __('Import <strong>coupons</strong> to your store using CSV file.', self::$text_domain), array($this, 'coupon_importer'));
     }
     if (!empty($_GET['action']) && $_GET['action'] == 'sent_gift_certificate' && !empty($_GET['page']) && $_GET['page'] == 'woocommerce_smart_coupon_csv_import') {
         $email = $_POST['smart_coupon_email'];
         $amount = $_POST['smart_coupon_amount'];
         $message = stripslashes($_POST['smart_coupon_message']);
         $this->send_gift_certificate($email, $amount, $message);
     }
 }
コード例 #19
0
                    $fetch_attachments = !empty($_POST['attachments']);
                    $result = $this->import($_GET['id'], $fetch_attachments);
                    if (is_wp_error($result)) {
                        echo $result->get_error_message();
                    }
                    break;
            }
            $this->footer();
        }
        function WP_Import()
        {
            // Nothing.
        }
    }
    /**
     * Register WordPress Importer
     *
     * @since unknown
     * @var WP_Import
     * @name $wp_import
     */
    $wp_import = new WP_Import();
    register_importer('wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array($wp_import, 'dispatch'));
}
// class_exists( 'WP_Importer' )
/*
function wordpress_importer_init() {
    load_plugin_textdomain( 'wordpress-importer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_action( 'init', 'wordpress_importer_init' );
*/
コード例 #20
0
 /**
  * register_per_product_shipping_importer function.
  *
  * @access public
  * @return void
  */
 function register_per_product_shipping_importer()
 {
     if (defined('WP_LOAD_IMPORTERS')) {
         register_importer('woocommerce_per_product_shipping_csv', __('WooCommerce Per-product shipping rates (CSV)', 'woocommerce'), __('Import <strong>per-product shipping rates</strong> to your store via a csv file.', 'woocommerce'), 'woocommerce_per_product_shipping_csv');
     }
 }
コード例 #21
0
ファイル: html-importer.php プロジェクト: kevinotsuka/datapop
		<style type="text/css">
			textarea#import-result { height: 12em; width: 100%; }
			#importing th { width: 32% } 
			#importing th#id { width: 4% }
			#importing tbody tr:nth-child( odd ) { background: #f9f9f9; }
			span.attachment_error { display: block; padding-left: 2em; color: #d54e21; /* WP orange */ }
		</style>
		<?php 
        }
        function HTML_Import()
        {
            add_action('admin_head', array(&$this, 'importer_styles'));
        }
    }
}
// class_exists( 'WP_Importer' )
$html_import = new HTML_Import();
register_importer('html', __('HTML', 'import-html-pages'), sprintf(__('Import the contents of HTML files as posts, pages, or any custom post type. Visit <a href="%s">the options page</a> first to select which portions of your documents should be imported.', 'import-html-pages'), 'options-general.php?page=html-import.php'), array($html_import, 'dispatch'));
// in case this server doesn't have php_mbstring enabled in php.ini...
if (!function_exists('mb_strlen')) {
    function mb_strlen($string)
    {
        return strlen(utf8_decode($string));
    }
}
if (!function_exists('mb_strrpos')) {
    function mb_strrpos($haystack, $needle, $offset = 0)
    {
        return strrpos(utf8_decode($haystack), $needle, $offset);
    }
}
コード例 #22
0
        static function register_importer()
        {
            if (!defined('WP_LOAD_IMPORTERS'))
                return;
            //Moved in from blogger_importer_init
            load_plugin_textdomain('blogger-importer', false, dirname(plugin_basename(__file__)) . '/languages');

            $blogger_import = new Blogger_Import();
            register_importer('blogger', __('Blogger', 'blogger-importer'), __('Import categories, posts, images and comments then maps users from a Blogger blog.', 'blogger-importer'), array($blogger_import,'start'));
        }
コード例 #23
0
ファイル: dotclear.php プロジェクト: helmonaut/owb-mirror
                $this->import_categories();
                break;
            case 2:
                $this->import_users();
                break;
            case 3:
                $result = $this->import_posts();
                if (is_wp_error($result)) {
                    echo $result->get_error_message();
                }
                break;
            case 4:
                $this->import_comments();
                break;
            case 5:
                $this->import_links();
                break;
            case 6:
                $this->cleanup_dcimport();
                break;
        }
        $this->footer();
    }
    function Dotclear_Import()
    {
        // Nothing.
    }
}
$dc_import = new Dotclear_Import();
register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog'), array($dc_import, 'dispatch'));
コード例 #24
0
ファイル: livejournal.php プロジェクト: beaucollins/wp
        delete_option('ljapi_verified');
        delete_option('ljapi_total');
        delete_option('ljapi_count');
        delete_option('ljapi_lastsync');
        delete_option('ljapi_last_sync_count');
        delete_option('ljapi_sync_item_times');
        delete_option('ljapi_lastsync_posts');
        delete_option('ljapi_post_batch');
        delete_option('ljapi_imported_count');
        delete_option('ljapi_maxid');
        delete_option('ljapi_usermap');
        delete_option('ljapi_highest_id');
        delete_option('ljapi_highest_comment_id');
        delete_option('ljapi_comment_batch');
        delete_option('ljapi_step');
        $wpdb->update($wpdb->comments, array('comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => ''), array('comment_type' => 'livejournal-done'));
        $wpdb->update($wpdb->comments, array('comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => ''), array('comment_type' => 'livejournal'));
        do_action('import_end');
    }
    function LJ_API_Import()
    {
        $this->__construct();
    }
    function __construct()
    {
        // Nothing
    }
}
$lj_api_import = new LJ_API_Import();
register_importer('livejournal', __('LiveJournal'), __('Import posts from LiveJournal using their API.'), array($lj_api_import, 'dispatch'));
コード例 #25
0
function wordpress_importer_init()
{
    load_plugin_textdomain('wordpress-importer', false, dirname(plugin_basename(__FILE__)) . '/languages');
    /**
     * WordPress Importer object for registering the import callback
     * @global WP_Import $wp_import
     */
    $GLOBALS['wp_import'] = new WP_Import();
    register_importer('wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array($GLOBALS['wp_import'], 'dispatch'));
}
コード例 #26
0
				case 6 :
					$this->get_archive();
					break;
				case 7 :
					$this->restore_settings();
					break;
				case 8 :
					$this->republish_blog();
					break;
				case 9 :
					$this->congrats();
					break;
			}
			die;
			
		} else {
			$this->greet();
		}
	}

	function Blogger_Import() {
		// This space intentionally left blank.
	}
}

$blogger_import = new Blogger_Import();

register_importer('blogger', 'Blogger', __('Import posts and comments from a Blogger account'), array ($blogger_import, 'start'));

?>
コード例 #27
0
 function gdlr_importer_init()
 {
     load_plugin_textdomain('gdlr-importer', false, dirname(plugin_basename(__FILE__)) . '/languages');
     $GLOBALS['gdlr_import'] = new GDLR_Import();
     register_importer('goodlayers-importer', 'Goodlayers Importer', __('Import everything shown in the theme demo site', 'gdlr-importer'), array($GLOBALS['gdlr_import'], 'dispatch'));
 }
コード例 #28
0
ファイル: mt.php プロジェクト: robertlange81/Website
        $this->get_authors_from_post();
        $this->get_entries();
        $this->process_posts();
    }
    function dispatch()
    {
        if (empty($_GET['step'])) {
            $step = 0;
        } else {
            $step = (int) $_GET['step'];
        }
        switch ($step) {
            case 0:
                $this->greet();
                break;
            case 1:
                $this->select_authors();
                break;
            case 2:
                $this->import();
                break;
        }
    }
    function MT_Import()
    {
        // Nothing.
    }
}
$mt_import = new MT_Import();
register_importer('mt', 'Movable Type', __('Import posts and comments from your Movable Type blog'), array($mt_import, 'dispatch'));
コード例 #29
0
 /**
  * Register importers for use
  */
 public function register_importers()
 {
     register_importer('woocommerce_csv', 'WooCommerce Products (CSV)', __('Import <strong>products</strong> to your store via a csv file.', 'wc_csv_import'), 'WC_PCSVIS_Importer::product_importer');
     register_importer('woocommerce_variation_csv', 'WooCommerce Product Variations (CSV)', __('Import <strong>product variations</strong> to your store via a csv file.', 'wc_csv_import'), 'WC_PCSVIS_Importer::variation_importer');
 }
コード例 #30
0
<p><?php 
        _e('Completed GreyMatter import!');
        ?>
</p>
<?php 
        $this->footer();
    }
    function dispatch()
    {
        if (empty($_GET['step'])) {
            $step = 0;
        } else {
            $step = (int) $_GET['step'];
        }
        switch ($step) {
            case 0:
                $this->greet();
                break;
            case 1:
                $this->import();
                break;
        }
    }
    function GM_Import()
    {
        // Nothing.
    }
}
$gm_import = new GM_Import();
register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog'), array($gm_import, 'dispatch'));