Plugin Directory

Changeset 3090934


Ignore:
Timestamp:
05/22/2024 01:46:28 PM (23 months ago)
Author:
skyword
Message:

v1.1.2, updates to images - author attribution, Yoast mime type issue

Location:
skyword-publishing-api/tags/1.1.2
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • skyword-publishing-api/tags/1.1.2/php/routes/class-skyword-images.php

    r3079629 r3090934  
    164164        $name        = sanitize_file_name( $data['filename'] );
    165165        $type        = 'image/' . substr($data['filename'], strpos($data['filename'], '.') + 1);
     166        // Yoast SEO plugin requires 'image/jpeg' and will not accept 'image/jpg'
     167        if ( in_array( 'wordpress-seo/wp-seo.php', $activePlugins, true ) ) {
     168            if ($type === 'image/jpg') {
     169                $type = 'image/jpeg';
     170            }
     171        }
    166172        $bits        = base64_decode($data['file']);
    167173        $title       = $name;
     
    183189            'guid'           => $upload['url']
    184190        );
     191
     192        if ( null !== $data['author'] && is_numeric( trim( $data['author'] ) ) ) {
     193            $attachment['post_author'] = (int)$data['author'];
     194        }
     195
    185196
    186197        $id = wp_insert_attachment( $attachment, $upload['file'], $postId );
  • skyword-publishing-api/tags/1.1.2/readme.txt

    r3079629 r3090934  
    2222== Changelog ==
    2323
     24= 1.1.2 =
     25* Accept an author ID for images
     26* Alter image MIME types for Yoast
     27
    2428= 1.1.1 =
    2529* Friendly slug for Coauthors Plus plugin
  • skyword-publishing-api/tags/1.1.2/skyword.php

    r3079629 r3090934  
    33Plugin Name: Skyword Publishing API
    44Description: Integration with the Skyword360 content publication platform.
    5 Version: 1.1.1
     5Version: 1.1.2
    66Author: Skyword, Inc.
    77Author URI: http://www.skyword.com
     
    1717define( 'SKYWORD_REST_API_VERSION', "Skyword REST API plugin " . $plugin_version );
    1818if ( !defined('SKYWORD_VN') )
    19     define( 'SKYWORD_VN', "1.11" ); //This CANNOT have two decimal places.
     19    define( 'SKYWORD_VN', "1.12" ); //This CANNOT have two decimal places.
    2020//.1.4 is NOT valid.
    2121
Note: See TracChangeset for help on using the changeset viewer.