Plugin Directory

Changeset 2860602


Ignore:
Timestamp:
02/06/2023 07:19:13 AM (3 years ago)
Author:
shorthandconnect
Message:

Created tag 1.3.27

Location:
shorthand-connect
Files:
2 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shorthand-connect/tags/1.3.27/README.txt

    r2817526 r2860602  
    55Requires at least: 4.0
    66Tested up to: 6.1
    7 Stable tag: 1.3.26
     7Stable tag: 1.3.27
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    6464== Changelog ==
    6565
     66= 1.3.27 =
     67* Added Mass Publishing Feature
     68
    6669= 1.3.26 =
    6770* Restyled and repositioned "Update Shorthand Story" button for better clarity.
  • shorthand-connect/tags/1.3.27/shorthand_connect.php

    r2817526 r2860602  
    33/**
    44 * @package Shorthand Connect
    5  * @version 1.3.26
     5 * @version 1.3.27
    66 */
    77/*
     
    1010Description: Import your Shorthand stories into your Wordpress CMS as simply as possible - magic!
    1111Author: Shorthand
    12 Version: 1.3.26
     12Version: 1.3.27
    1313Author URI: http://shorthand.com
    1414*/
     
    2121
    2222require_once('includes/api-v2.php');
     23require_once('includes/mass_pull.php');
    2324
    2425require_once('includes/shorthand_options.php');
     
    619620}
    620621
     622/* Add "Pull Story" to post dropdown */
     623add_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 */
     629add_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 */
     651add_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
    621658?>
  • shorthand-connect/trunk/README.txt

    r2817526 r2860602  
    55Requires at least: 4.0
    66Tested up to: 6.1
    7 Stable tag: 1.3.26
     7Stable tag: 1.3.27
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    6464== Changelog ==
    6565
     66= 1.3.27 =
     67* Added Mass Publishing Feature
     68
    6669= 1.3.26 =
    6770* Restyled and repositioned "Update Shorthand Story" button for better clarity.
  • shorthand-connect/trunk/shorthand_connect.php

    r2817526 r2860602  
    33/**
    44 * @package Shorthand Connect
    5  * @version 1.3.26
     5 * @version 1.3.27
    66 */
    77/*
     
    1010Description: Import your Shorthand stories into your Wordpress CMS as simply as possible - magic!
    1111Author: Shorthand
    12 Version: 1.3.26
     12Version: 1.3.27
    1313Author URI: http://shorthand.com
    1414*/
     
    2121
    2222require_once('includes/api-v2.php');
     23require_once('includes/mass_pull.php');
    2324
    2425require_once('includes/shorthand_options.php');
     
    619620}
    620621
     622/* Add "Pull Story" to post dropdown */
     623add_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 */
     629add_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 */
     651add_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
    621658?>
Note: See TracChangeset for help on using the changeset viewer.