What is basic structure of xml for importing a page in wordpress?

I am trying to import file from xml to word press i need to know waht is sturcture for importing the xml file into a page in wordpress

Related posts

1 comment

  1. WordPress has a full load of Importer Plugins that you can install from the ~/wp-admin/tools/import screen. They will serve as nice reference.

    Then there’s Ralf Alberts @Ralf912 Importer skeleton on GitHub/Gist which you can take as reference. Please note that this skeleton uses namespaces and therefore requires PHP 5.3+, or a rewrite.

    The main/important parts are the following:

    1. Check if the request comes from admin.php?import=...

      if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
          return;
      
    2. Load Importer API (Importer API = Backendpage admin.php?import=...)

      require_once ABSPATH . 'wp-admin/includes/import.php';
      
    3. Load the importer base class

      if ( ! class_exists( 'WP_Importer' ) ) {
          $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
          if ( file_exists( $class_wp_importer ) )
              require $class_wp_importer;
      }
      
    4. Register your Custom Importer to WordPress by using register_importer()Codex explanation

      register_importer(
          'custom',
          'CustomPress',
          __('Import <strong>posts</strong> or not.', 'custom-importer'),
          array(
              new Custom_Import(),
              'dispatch'
              )
      );
      

Comments are closed.