This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Export WordPress post data to CSV | |
* @author Wali Hassan | |
*/ | |
/** | |
* Author's Name Article URL Article Word Count Yoast Readability Score Yoast SEO Score Article Category Article Publish Date | |
* Export fields: array of strings representing $post properties to output to CSV. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Posts CSV API REWRITE | |
*/ | |
add_action( 'init', 'wpse9870_init_internal' ); | |
function wpse9870_init_internal() | |
{ | |
add_rewrite_rule( 'exportcsv.php$', 'index.php/exportcsv?api_key=123', 'top' ); | |
} | |
add_filter( 'query_vars', 'wpse9870_query_vars' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function upload_websolr_script($url){ | |
$url = 'https://index.websolr.com/solr/xxxxxxxxx/update/csv/?commit=true'; | |
if(!empty($_FILES['csv_file']['name'])) { | |
$upload_dir = wp_upload_dir(); | |
$result = move_uploaded_file($_FILES["csv_file"]["tmp_name"],$upload_dir['path'].'/'. $_FILES["csv_file"]["name"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="bkt_db_tables"> | |
<h1>Games</h1> | |
<table id="example" class="display" width="100%"> | |
<thead> | |
<tr> | |
<th>Game_ID</th> | |
<th>Home_Team</th> | |
</tr> |