Plugin Directory

Changeset 1400276


Ignore:
Timestamp:
04/20/2016 12:07:38 PM (10 years ago)
Author:
robmcvey
Message:

Allows posts that are auto-published to be assigned to a custom user

Location:
copify/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • copify/trunk/Lib/CopifyWordpress.php

    r1400273 r1400276  
    1212 * Plugin version
    1313 */
    14     protected $version = '1.1.3';
     14    protected $version = '1.2.0';
    1515
    1616/**
     
    934934            'post_type' => 'post' // [ 'post' | 'page' | 'link' | 'nav_menu_item' | 'custom_post_type' ]
    935935        );
    936         // Do we have an admin ID we can set as post author?
     936        // Do we have an a selected user to post under? OR an admin ID we can set as post author?
    937937        $admins = $this->wordpress('get_users', 'role=administrator');
    938         if (isset($admins[0]) && is_object($admins[0]) && property_exists($admins[0], 'data') && property_exists($admins[0]->data, 'ID')) {
     938        // Get API credentials
     939        $CopifyLoginDetails = $this->wordpress('get_option', 'CopifyLoginDetails' , false);
     940        if (isset($CopifyLoginDetails['CopifyWPUser']) && is_numeric($CopifyLoginDetails['CopifyWPUser'])) {
     941            $newPost['post_author'] = $CopifyLoginDetails['CopifyWPUser'];
     942        } else if (isset($admins[0]) && is_object($admins[0]) && property_exists($admins[0], 'data') && property_exists($admins[0]->data, 'ID')) {
    939943            $newPost['post_author'] = $admins[0]->data->ID;
    940944        }
  • copify/trunk/Test/Lib/CopifyWordpressTest.php

    r1400273 r1400276  
    236236        $this->CopifyWordpress = $this->getMock('CopifyWordpress', array('wordpress', 'outputJson', 'setheader'));
    237237        $version = $this->CopifyWordpress->getVersion();
    238         $this->assertEquals('1.1.3', $version);
     238        $this->assertEquals('1.2.0', $version);
    239239        $mockVal = array(
    240240            'CopifyEmail' => 'foo@bar.com',
  • copify/trunk/basics.php

    r1400273 r1400276  
    1010// Dev mode
    1111if (!defined('COPIFY_DEVMODE')) {
    12     define('COPIFY_DEVMODE', true);
     12    define('COPIFY_DEVMODE', false);
    1313}
    1414
  • copify/trunk/copify.php

    r1400273 r1400276  
    44Plugin URI: https://github.com/copify/copify-wordpress
    55Description: Automatically publish unique, relevant content every week from Copify's team of professional writers.
    6 Version: 1.1.3
     6Version: 1.2.0
    77Author: Rob McVey
    88Author URI: http://uk.copify.com/
  • copify/trunk/readme.txt

    r1400273 r1400276  
    11=== Copify ===
    2 Version: 1.1.3
     2Version: 1.2.0
    33Contributors: robmcvey
    44Tags: blog writers, automatic blogging, post writers, auto blogging, content, copywriting, copywriters, blogging, writers, writing, seo
     
    3939== Changelog ==
    4040
     41= 1.2.0 =
     42* Allows posts that are auto-published to be assigned to a custom user
     43
    4144= 1.1.3 =
    4245* Tested up to WP 4.5
Note: See TracChangeset for help on using the changeset viewer.