This commit is contained in:
Peter Molnar 2015-05-26 10:33:08 +01:00
parent 0941b04d02
commit 9de4ece589
2 changed files with 15 additions and 7 deletions

View file

@ -3,7 +3,7 @@
Plugin Name: Keyring Reactions Importer Plugin Name: Keyring Reactions Importer
Plugin URI: https://github.com/petermolnar/keyring-reactions-importer Plugin URI: https://github.com/petermolnar/keyring-reactions-importer
Description: A recations (comments, favs, etc. ) importer based on Keyring Description: A recations (comments, favs, etc. ) importer based on Keyring
Version: 1.0 Version: 1.1
Author: Peter Molnar <hello@petermolnar.eu> Author: Peter Molnar <hello@petermolnar.eu>
Author URI: http://petermolnar.eu/ Author URI: http://petermolnar.eu/
License: GPLv3 License: GPLv3
@ -98,8 +98,8 @@ abstract class Keyring_Reactions_Base {
// Add a Keyring handler to push us to the next step of the importer once connected // Add a Keyring handler to push us to the next step of the importer once connected
add_action( 'keyring_connection_verified', array( &$this, 'verified_connection' ), 10, 2 ); add_action( 'keyring_connection_verified', array( &$this, 'verified_connection' ), 10, 2 );
add_action( 'add_meta_boxes', array(&$this, 'add_post_meta_box' )); //add_action( 'add_meta_boxes', array(&$this, 'add_post_meta_box' ));
add_action( 'save_post', array(&$this, 'handle_post_meta_box' ) ); //add_action( 'save_post', array(&$this, 'handle_post_meta_box' ) );
// additional comment types // additional comment types
add_action('admin_comment_types_dropdown', array(&$this, 'comment_types_dropdown')); add_action('admin_comment_types_dropdown', array(&$this, 'comment_types_dropdown'));
@ -790,10 +790,11 @@ abstract class Keyring_Reactions_Base {
function display_post_meta_box() { function display_post_meta_box() {
wp_nonce_field( basename( __FILE__ ), static::SILONAME ); wp_nonce_field( basename( __FILE__ ), static::SILONAME );
global $post;
?> ?>
<p> <p>
<?php <?php
printf ( '<input style="margin-right: 1em;" class="button button-primary " "id="import-%s" name="import-%s" type="submit" value="Import"></input>', static::SLUG, static::SLUG, static::SLUG, static::SLUG ); printf ( '<input style="margin-right: 1em;" class="button button-primary " "id="import-%s" name="import-%s" type="submit" value="Import for #%s"></input>', static::SLUG, static::SLUG, $post->ID );
printf ('<label for="import-%s">%s</label><br />', static::SLUG, sprintf(__('Manually import reactions from %s for this post now'), static::SILONAME )); printf ('<label for="import-%s">%s</label><br />', static::SLUG, sprintf(__('Manually import reactions from %s for this post now'), static::SILONAME ));
?> ?>
</p> </p>
@ -816,8 +817,9 @@ abstract class Keyring_Reactions_Base {
return $post_id; return $post_id;
if (isset( $_POST['import-' . static::SLUG ] )) { if (isset( $_POST['import-' . static::SLUG ] )) {
die ('eddig ok'); $id = split('#', $_POST['import-' . static::SLUG ]);
$this->do_single_import( $post_id ); $id = $id[1];
$this->do_single_import( $id );
} }
} }

View file

@ -3,7 +3,7 @@ Contributors: cadeyrn
Tags: instagram, facebook, flickr, 500px, backfeed, indieweb, comments, likes, favorites Tags: instagram, facebook, flickr, 500px, backfeed, indieweb, comments, likes, favorites
Requires at least: 3.0 Requires at least: 3.0
Tested up to: 4.2.1 Tested up to: 4.2.1
Stable tag: 1.0 Stable tag: 1.1
License: GPLv3 License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -53,6 +53,12 @@ Countless thanks for the [Keyring Social Importers](https://wordpress.org/plugin
== Changelog == == Changelog ==
= 1.1 =
*2015-05-26*
* Facebook broke it's API... again. Fixed.
= 1.0 = = 1.0 =
*2015-05-01* *2015-05-01*