Plugin Directory

Changeset 1225646


Ignore:
Timestamp:
08/19/2015 10:05:33 PM (11 years ago)
Author:
RylanH
Message:

Fix for old versions of PHP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storyform/trunk/class-storyform-editor-page.php

    r1225531 r1225646  
    113113        // If published, grab the latest revision as there may be some unpublished changes
    114114        if( $post['post_status'] === 'publish' ){
    115             $revision = array_values( wp_get_post_revisions( $id ) )[0]->to_array();
     115            $array = array_values( wp_get_post_revisions( $id ) );
     116            $revision = $array[0]->to_array();
    116117            $post['post_content'] = $revision['post_content'];
    117118            $post['post_title'] = $revision['post_title'];
     
    234235
    235236        if( $post['post_status'] === 'publish' && count( $revisions ) > 0 ){
    236             $revision = array_values( $revisions )[0]->to_array();
     237            $array = array_values( $revisions );
     238            $revision = $array[0]->to_array();
    237239            $post = array(
    238240                'ID' => $id,
Note: See TracChangeset for help on using the changeset viewer.