Plugin Directory

Changeset 1736371


Ignore:
Timestamp:
09/26/2017 03:03:36 PM (9 years ago)
Author:
canvasflow
Message:

Add support for wordpress 5.4 arrays

Location:
canvasflow/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • canvasflow/trunk/README.md

    r1715448 r1736371  
    5555
    5656#### Changelog
     57##### 0.9.6
     58* Replace [] with array()
     59
    5760##### 0.9.5
    5861* Add error message when there are no styles in a publication
    5962
    6063##### 0.9.4
     64* Change plugin base_url from http://api.canvasflow.webhop.net/ to http://api.canvasflow.io/
    6165* Upload pages to Canvasflow
    6266
     
    7579
    7680#### Upgrade Notice
     81##### 0.9.6
     82Add support for PHP 5.4 and below
     83
    7784##### 0.9.5
    7885Add a message when there are no styles in a publication
  • canvasflow/trunk/canvasflow-plugin.php

    r1715452 r1736371  
    33  Plugin Name: Canvasflow for WordPress
    44  Description: This out-of-the-box connector provides a quick and simple way to push your blog content directly to an existing Canvasflow publication.
    5   Version: 0.9.5
     5  Version: 0.9.6
    66    Developer:  Canvasflow
    77    Developer URI: https://canvasflow.io
  • canvasflow/trunk/includes/canvasflow-main.php

    r1714764 r1736371  
    99
    1010    class Canvasflow_Main {
    11         private $base_url = 'http://api.canvasflow.io/v1/index.cfm';
     11        private $base_url = 'http://api.canvasflow.webhop.net/v1/index.cfm';
    1212        private $wpdb;
    1313        private $user_id;
     
    6565                echo "<div class=\"error-message-static\"><div>Missing <a href=\"admin.php?page=canvasflow-settings\" style=\"color: #000\">Publication.</a></div></div>";
    6666            } else {
    67                 $styles = [];
     67                $styles = array();
    6868                foreach($this->get_styles_from_remote($publication_id, $secret_key) as $style) {
    6969                    array_push($styles, $style);
     
    157157                }
    158158
    159                 $posts = [];
     159                $posts = array();
    160160
    161161                $result_posts = $this->wpdb->get_results($query);
  • canvasflow/trunk/includes/canvasflow-post-manager.php

    r1714764 r1736371  
    6464            }
    6565
    66             $posts = [];
     66            $posts = array();
    6767
    6868            $result_posts = $this->wpdb->get_results($query);
     
    232232            }
    233233
    234             $posts = [];
     234            $posts = array();
    235235
    236236            foreach ( $this->wpdb->get_results($query) as $post ){
  • canvasflow/trunk/includes/canvasflow-settings.php

    r1715448 r1736371  
    99
    1010    class Canvasflow_Settings {
    11         private $base_url = 'http://api.canvasflow.io/v1/index.cfm';
     11        private $base_url = 'http://api.canvasflow.webhop.net/v1/index.cfm';
    1212        private $wpdb;
    1313        private $user_id;
     
    1616        private $merge_adjacent_paragraphs = FALSE;
    1717        private $publication_id = '';
    18         private $publications = [];
     18        private $publications = array();
    1919        private $style_id = 0;
    20         private $styles = [];     
     20        private $styles = array();     
    2121        private $valid_secret_key = TRUE;
    2222       
     
    3939                if($db_secret_key != '') {
    4040                    $this->secret_key = $db_secret_key;
    41                     $this->publications = [];
     41                    $this->publications = array();
    4242                    foreach($this->get_remote_publications($db_secret_key) as $publication) {
    4343                        if($publication['type'] == 'article') {
     
    4949                        $this->publication_id = $db_publication_id;
    5050
    51                         $this->styles = [];
     51                        $this->styles = array();
    5252                        foreach($this->get_remote_styles($db_secret_key, $this->publication_id) as $style) {
    5353                            array_push($this->styles, $style);
     
    6161                    } else {
    6262                        $this->style_id = '';
    63                         $this->styles = [];
     63                        $this->styles = array();
    6464                    }
    6565                }
    6666            } else {
    6767                $this->publication_id = '';
    68                 $this->publications = [];
     68                $this->publications = array();
    6969                $this->style_id = '';
    70                 $this->styles = [];
     70                $this->styles = array();
    7171            }
    7272        }
     
    110110            $this->merge_adjacent_paragraphs = 1;
    111111            $this->publication_id = '';
    112             $this->publications = [];
     112            $this->publications = array();
    113113            $this->style_id = 0;
    114             $this->styles = []
     114            $this->styles = array()
    115115        }
    116116
     
    118118            $this->publication_id = $new_publication_id;
    119119
    120             $this->publications = [];
     120            $this->publications = array();
    121121            foreach($this->get_remote_publications($this->secret_key) as $publication) {
    122122                array_push($this->publications, $publication);
    123123            }
    124124
    125             $this->styles = [];
     125            $this->styles = array();
    126126            foreach($this->get_remote_styles($this->secret_key, $this->publication_id) as $style) {
    127127                array_push($this->styles, $style);
     
    202202                }
    203203            }
    204             return [];
     204            return array();
    205205        }
    206206
     
    216216                $body = $response['body'];
    217217                if($http_response_code == 200){
    218                     if($body == "[]"){
     218                    if($body == "array()"){
    219219                        $message = "There are no styles for this publication";
    220220                        echo "<div class=\"error-message\"><div><b>{$message}</b></div></div>";
  • canvasflow/trunk/readme.txt

    r1715448 r1736371  
    7070
    7171== Changelog ==
     72= 0.9.6 =
     73* Replace [] with array()
     74
    7275= 0.9.5 =
    7376* Add a message when a publication don't have any styles
     
    9093
    9194== Upgrade Notice ==
     95= 0.9.6 =
     96Add support for PHP 5.4 and below
     97
    9298= 0.9.4 =
    9399This version let the user post pages as article in Canvasflow.
Note: See TracChangeset for help on using the changeset viewer.