Changeset 2860602
- Timestamp:
- 02/06/2023 07:19:13 AM (3 years ago)
- Location:
- shorthand-connect
- Files:
-
- 2 added
- 4 edited
- 1 copied
-
tags/1.3.27 (copied) (copied from shorthand-connect/trunk)
-
tags/1.3.27/README.txt (modified) (2 diffs)
-
tags/1.3.27/includes/mass_pull.php (added)
-
tags/1.3.27/shorthand_connect.php (modified) (4 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/mass_pull.php (added)
-
trunk/shorthand_connect.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shorthand-connect/tags/1.3.27/README.txt
r2817526 r2860602 5 5 Requires at least: 4.0 6 6 Tested up to: 6.1 7 Stable tag: 1.3.2 67 Stable tag: 1.3.27 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 64 64 == Changelog == 65 65 66 = 1.3.27 = 67 * Added Mass Publishing Feature 68 66 69 = 1.3.26 = 67 70 * Restyled and repositioned "Update Shorthand Story" button for better clarity. -
shorthand-connect/tags/1.3.27/shorthand_connect.php
r2817526 r2860602 3 3 /** 4 4 * @package Shorthand Connect 5 * @version 1.3.2 65 * @version 1.3.27 6 6 */ 7 7 /* … … 10 10 Description: Import your Shorthand stories into your Wordpress CMS as simply as possible - magic! 11 11 Author: Shorthand 12 Version: 1.3.2 612 Version: 1.3.27 13 13 Author URI: http://shorthand.com 14 14 */ … … 21 21 22 22 require_once('includes/api-v2.php'); 23 require_once('includes/mass_pull.php'); 23 24 24 25 require_once('includes/shorthand_options.php'); … … 619 620 } 620 621 622 /* Add "Pull Story" to post dropdown */ 623 add_filter('bulk_actions-edit-shorthand_story', function($bulk_actions) { 624 $bulk_actions['bulk-pull-stories'] = __('Pull Story', 'txtdomain'); 625 return $bulk_actions; 626 }); 627 628 /* Pull the stories */ 629 add_filter('handle_bulk_actions-edit-shorthand_story', function($redirect_url, $action, $post_ids) { 630 //Run on posts which have bulk-pull-stories set to true 631 if ($action == 'bulk-pull-stories') { 632 $storyids = array(); 633 foreach ($post_ids as $post_id) { 634 //get story ID and push to array 635 $story_id = get_post_meta( $post_id, 'story_id', true ); 636 array_push($storyids, $story_id); 637 638 //copy latest zip files 639 sh_copy_story($post_id, $story_id, 'true', 'false'); 640 641 //Update Meta Data 642 shand_update_story($post_id, $story_id); 643 } 644 //Change to bulk-pulled-stories for notice below 645 $redirect_url = add_query_arg('bulk-pulled-stories', count($post_ids), $redirect_url); 646 } 647 return $redirect_url; 648 }, 10, 3); 649 650 /* Add Notice after post has pulled */ 651 add_action('admin_notices', function() { 652 if (!empty($_REQUEST['bulk-pulled-stories'])) { 653 $num_changed = (int) $_REQUEST['bulk-pulled-stories']; 654 printf('<div id="message" class="updated notice is-dismissable"><p>' . __('Pulled %d stories.' , 'txtdomain') . '</p></div>', $num_changed); 655 } 656 }); 657 621 658 ?> -
shorthand-connect/trunk/README.txt
r2817526 r2860602 5 5 Requires at least: 4.0 6 6 Tested up to: 6.1 7 Stable tag: 1.3.2 67 Stable tag: 1.3.27 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 64 64 == Changelog == 65 65 66 = 1.3.27 = 67 * Added Mass Publishing Feature 68 66 69 = 1.3.26 = 67 70 * Restyled and repositioned "Update Shorthand Story" button for better clarity. -
shorthand-connect/trunk/shorthand_connect.php
r2817526 r2860602 3 3 /** 4 4 * @package Shorthand Connect 5 * @version 1.3.2 65 * @version 1.3.27 6 6 */ 7 7 /* … … 10 10 Description: Import your Shorthand stories into your Wordpress CMS as simply as possible - magic! 11 11 Author: Shorthand 12 Version: 1.3.2 612 Version: 1.3.27 13 13 Author URI: http://shorthand.com 14 14 */ … … 21 21 22 22 require_once('includes/api-v2.php'); 23 require_once('includes/mass_pull.php'); 23 24 24 25 require_once('includes/shorthand_options.php'); … … 619 620 } 620 621 622 /* Add "Pull Story" to post dropdown */ 623 add_filter('bulk_actions-edit-shorthand_story', function($bulk_actions) { 624 $bulk_actions['bulk-pull-stories'] = __('Pull Story', 'txtdomain'); 625 return $bulk_actions; 626 }); 627 628 /* Pull the stories */ 629 add_filter('handle_bulk_actions-edit-shorthand_story', function($redirect_url, $action, $post_ids) { 630 //Run on posts which have bulk-pull-stories set to true 631 if ($action == 'bulk-pull-stories') { 632 $storyids = array(); 633 foreach ($post_ids as $post_id) { 634 //get story ID and push to array 635 $story_id = get_post_meta( $post_id, 'story_id', true ); 636 array_push($storyids, $story_id); 637 638 //copy latest zip files 639 sh_copy_story($post_id, $story_id, 'true', 'false'); 640 641 //Update Meta Data 642 shand_update_story($post_id, $story_id); 643 } 644 //Change to bulk-pulled-stories for notice below 645 $redirect_url = add_query_arg('bulk-pulled-stories', count($post_ids), $redirect_url); 646 } 647 return $redirect_url; 648 }, 10, 3); 649 650 /* Add Notice after post has pulled */ 651 add_action('admin_notices', function() { 652 if (!empty($_REQUEST['bulk-pulled-stories'])) { 653 $num_changed = (int) $_REQUEST['bulk-pulled-stories']; 654 printf('<div id="message" class="updated notice is-dismissable"><p>' . __('Pulled %d stories.' , 'txtdomain') . '</p></div>', $num_changed); 655 } 656 }); 657 621 658 ?>
Note: See TracChangeset
for help on using the changeset viewer.