Plugin Directory

Changeset 2887121


Ignore:
Timestamp:
03/26/2023 02:33:20 PM (3 years ago)
Author:
wordable
Message:

8.2.4

Location:
wordable
Files:
1 added
5 edited
20 copied

Legend:

Unmodified
Added
Removed
  • wordable/tags/8.2.4/includes/actions.php

    r2845107 r2887121  
    109109  }
    110110
    111   function upload_image_action() {
     111  function upload_image_action($params) {
    112112    if(!file_is_valid_image($_FILES['file']['tmp_name'])) {
    113113      throw new WordableException('warnings.connections.wordpress.upload_image.invalid_image');
     
    116116    $attachment_id = $this->throw_if_wp_error(media_handle_upload('file', 0));
    117117
    118     return array(
     118    $result = array(
    119119      'plugin_version' => WORDABLE_VERSION,
    120120      'wordpress_version' => get_bloginfo('version'),
     
    122122      'url' => esc_url(wp_get_attachment_url($attachment_id))
    123123    );
     124
     125    error_log(" --- params ---");
     126    error_log(var_export($params, true));
     127
     128    if(array_key_exists('image_attributes', $params)) {
     129      $image_attributes = $params['image_attributes'];
     130      error_log(" --- image_attributes ---");
     131      error_log(var_export($image_attributes, true));
     132
     133      if(array_key_exists('alt', $image_attributes)) {
     134        update_post_meta($attachment_id, '_wp_attachment_image_alt', $image_attributes['alt']);
     135      }
     136
     137      if(array_key_exists('caption', $image_attributes)) {
     138        wp_update_post(
     139          array('ID' => $attachment_id,
     140                'post_excerpt' => $image_attributes['caption']));
     141      }
     142    }
     143
     144    return $result;
    124145  }
    125146
  • wordable/tags/8.2.4/readme.txt

    r2860099 r2887121  
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    10 Stable Tag: 8.2.3
     10Stable Tag: 8.2.4
    1111
    1212This plugin allows you to instantly export Google Docs to WordPress posts or pages.
     
    136136== Changelog ==
    137137
     138= 8.2.4 =
     139* Saving Attachment Meta to the Database
     140
    138141= 8.1.3 =
    139142* UI Fixes
  • wordable/tags/8.2.4/settings/js/settings.js

    r2682639 r2887121  
    44      $('#wordable-plugin-settings-system-report-link').on('click', function() {
    55        navigator.clipboard.writeText($('#wordable-plugin-settings-system-report-text').text());
     6
    67        $('#wordable-plugin-settings-system-report-link').text('Copied to clipboard!');
    78      })
  • wordable/tags/8.2.4/wordable.php

    r2860099 r2887121  
    44 * Plugin URI: http://wordable.io
    55 * Description: This plugin allows you to instantly export Google Docs to WordPress posts or pages.
    6  * Version: 8.2.3
     6 * Version: 8.2.4
    77 * Author: Wordable
    88 * Author URI: https://wordable.io
    99 * Tested up to: 5.9.2
    1010 * Requires at least: 5.0
    11  * Stable tag: 8.2.3
     11 * Stable tag: 8.2.4
    1212 *
    1313 * Wordpress 5.0+
    1414 */
    1515
    16 define('WORDABLE_VERSION', '8.2.3');
     16define('WORDABLE_VERSION', '8.2.4');
    1717
    1818include 'includes/wordable_exception.php';
  • wordable/trunk/includes/actions.php

    r2845107 r2887121  
    109109  }
    110110
    111   function upload_image_action() {
     111  function upload_image_action($params) {
    112112    if(!file_is_valid_image($_FILES['file']['tmp_name'])) {
    113113      throw new WordableException('warnings.connections.wordpress.upload_image.invalid_image');
     
    116116    $attachment_id = $this->throw_if_wp_error(media_handle_upload('file', 0));
    117117
    118     return array(
     118    $result = array(
    119119      'plugin_version' => WORDABLE_VERSION,
    120120      'wordpress_version' => get_bloginfo('version'),
     
    122122      'url' => esc_url(wp_get_attachment_url($attachment_id))
    123123    );
     124
     125    error_log(" --- params ---");
     126    error_log(var_export($params, true));
     127
     128    if(array_key_exists('image_attributes', $params)) {
     129      $image_attributes = $params['image_attributes'];
     130      error_log(" --- image_attributes ---");
     131      error_log(var_export($image_attributes, true));
     132
     133      if(array_key_exists('alt', $image_attributes)) {
     134        update_post_meta($attachment_id, '_wp_attachment_image_alt', $image_attributes['alt']);
     135      }
     136
     137      if(array_key_exists('caption', $image_attributes)) {
     138        wp_update_post(
     139          array('ID' => $attachment_id,
     140                'post_excerpt' => $image_attributes['caption']));
     141      }
     142    }
     143
     144    return $result;
    124145  }
    125146
  • wordable/trunk/readme.txt

    r2860099 r2887121  
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    10 Stable Tag: 8.2.3
     10Stable Tag: 8.2.4
    1111
    1212This plugin allows you to instantly export Google Docs to WordPress posts or pages.
     
    136136== Changelog ==
    137137
     138= 8.2.4 =
     139* Saving Attachment Meta to the Database
     140
    138141= 8.1.3 =
    139142* UI Fixes
  • wordable/trunk/settings/js/settings.js

    r2682639 r2887121  
    44      $('#wordable-plugin-settings-system-report-link').on('click', function() {
    55        navigator.clipboard.writeText($('#wordable-plugin-settings-system-report-text').text());
     6
    67        $('#wordable-plugin-settings-system-report-link').text('Copied to clipboard!');
    78      })
  • wordable/trunk/wordable.php

    r2860099 r2887121  
    44 * Plugin URI: http://wordable.io
    55 * Description: This plugin allows you to instantly export Google Docs to WordPress posts or pages.
    6  * Version: 8.2.3
     6 * Version: 8.2.4
    77 * Author: Wordable
    88 * Author URI: https://wordable.io
    99 * Tested up to: 5.9.2
    1010 * Requires at least: 5.0
    11  * Stable tag: 8.2.3
     11 * Stable tag: 8.2.4
    1212 *
    1313 * Wordpress 5.0+
    1414 */
    1515
    16 define('WORDABLE_VERSION', '8.2.3');
     16define('WORDABLE_VERSION', '8.2.4');
    1717
    1818include 'includes/wordable_exception.php';
Note: See TracChangeset for help on using the changeset viewer.