Plugin Directory

Changeset 2185823


Ignore:
Timestamp:
11/04/2019 09:31:03 PM (6 years ago)
Author:
batmoo
Message:

Tag and release 0.9.1

https://github.com/Automattic/Edit-Flow/releases/tag/0.9.1

Location:
edit-flow
Files:
2 added
24 deleted
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • edit-flow/tags/0.9.1/blocks/dist/custom-status.build.js

    r2010360 r2185823  
    1 !function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([,function(t,e,n){"use strict";n.r(e);n(5),n(6);var o=wp.i18n.__,r=wp.editPost.PluginPostStatusInfo,u=wp.plugins.registerPlugin,i=wp.data,l=i.withSelect,s=i.withDispatch,a=wp.compose.compose,c=wp.components.SelectControl,d=window.EditFlowCustomStatuses.map(function(t){return{label:t.name,value:t.slug}});u("edit-flow-custom-status",{icon:"edit-flow",render:a(l(function(t){return{status:t("core/editor").getEditedPostAttribute("status")}}),s(function(t){return{onUpdate:function(e){var n;t("core/editor").editPost({status:e}),function(t){document.querySelector(".editor-post-save-draft")&&(document.querySelector(".editor-post-save-draft").innerText="".concat(o("Save")," ").concat(t))}((n=e,d.find(function(t){return t.value===n}).label))}}}))(function(t){var e=t.onUpdate,n=t.status;return wp.element.createElement(r,{className:"edit-flow-extended-post-status edit-flow-extended-post-status-".concat(n)},wp.element.createElement("h4",null,o("publish"!==n?"Extended Post Status":"Extended Post Status Disabled.","edit-flow")),"publish"!==n?wp.element.createElement(c,{label:"",value:n,options:d,onChange:e}):null,wp.element.createElement("small",{className:"edit-flow-extended-post-status-note"},"publish"!==n?o("Note: this will override all status settings above.","edit-flow"):o("Please switch to draft first.")))})})},,,,function(t,e){},function(t,e){}]);
     1!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([,function(t,e,n){"use strict";n.r(e);n(5),n(6);var o=wp.i18n.__,r=wp.editPost.PluginPostStatusInfo,u=wp.plugins.registerPlugin,s=wp.data,i=s.subscribe,l=s.dispatch,a=s.select,c=s.withSelect,d=s.withDispatch,f=wp.compose.compose,p=wp.components.SelectControl,m=window.EditFlowCustomStatuses.map(function(t){return{label:t.name,value:t.slug}}),b=function(t){return m.find(function(e){return e.value===t}).label},w=function(t){document.querySelector(".editor-post-save-draft")&&(document.querySelector(".editor-post-save-draft").innerText="".concat(o("Save")))};i(function(){if(a("core/editor").getCurrentPostId())if(a("core/editor").isCleanNewPost())l("core/editor").editPost({status:ef_default_custom_status});else{var t=a("core/editor").getEditedPostAttribute("status");void 0!==t&&"publish"!==t&&w(b(t))}});u("edit-flow-custom-status",{icon:"edit-flow",render:f(c(function(t){return{status:t("core/editor").getEditedPostAttribute("status")}}),d(function(t){return{onUpdate:function(e){t("core/editor").editPost({status:e}),w(b(e))}}}))(function(t){var e=t.onUpdate,n=t.status;return wp.element.createElement(r,{className:"edit-flow-extended-post-status edit-flow-extended-post-status-".concat(n)},wp.element.createElement("h4",null,o("publish"!==n?"Extended Post Status":"Extended Post Status Disabled.","edit-flow")),"publish"!==n?wp.element.createElement(p,{label:"",value:n,options:m,onChange:e}):null,wp.element.createElement("small",{className:"edit-flow-extended-post-status-note"},o("publish"!==n?"Note: this will override all status settings above.":"To select a custom status, please unpublish the content first.","edit-flow")))})})},,,,function(t,e){},function(t,e){}]);
    22//# sourceMappingURL=custom-status.build.js.map
  • edit-flow/tags/0.9.1/blocks/src/custom-status/block.js

    r2010360 r2185823  
    55let { PluginPostStatusInfo } = wp.editPost;
    66let { registerPlugin } = wp.plugins;
    7 let { withSelect, withDispatch } = wp.data;
     7let { subscribe, dispatch, select, withSelect, withDispatch } = wp.data;
    88let { compose } = wp.compose;
    99let { SelectControl } = wp.components;
     
    2121  let node = document.querySelector('.editor-post-save-draft');
    2222  if ( node ) {
    23     document.querySelector('.editor-post-save-draft').innerText = `${__( 'Save' ) } ${status}`
     23    document.querySelector( '.editor-post-save-draft' ).innerText = `${ __( 'Save' ) }`
    2424  }
    2525}
     26
     27// Set the status to the default custom status.
     28subscribe( function () {
     29  const postId = select( 'core/editor' ).getCurrentPostId();
     30  // Post isn't ready yet so don't do anything.
     31  if ( ! postId ) {
     32    return;
     33  }
     34
     35  // For new posts, we need to force the our default custom status.
     36  // Otherwise WordPress will force it to "Draft".
     37  const isCleanNewPost = select( 'core/editor' ).isCleanNewPost();
     38  if ( isCleanNewPost ) {
     39    dispatch( 'core/editor' ).editPost( {
     40      status: ef_default_custom_status
     41    } );
     42
     43    return;
     44  }
     45
     46  // Update the "Save" button.
     47  var status = select( 'core/editor' ).getEditedPostAttribute( 'status' );
     48  if ( typeof status !== 'undefined' && status !== 'publish' ) {
     49    sideEffectL10nManipulation( getStatusLabel( status ) );
     50  }
     51} );
    2652
    2753/**
     
    4874);
    4975
     76const mapSelectToProps = ( select ) => {
     77  return {
     78    status: select('core/editor').getEditedPostAttribute('status'),
     79  };
     80};
     81
     82const mapDispatchToProps = ( dispatch ) => {
     83  return {
     84    onUpdate( status ) {
     85      dispatch( 'core/editor' ).editPost( { status } );
     86      sideEffectL10nManipulation( getStatusLabel( status ) );
     87    },
     88  };
     89};
     90
    5091let plugin = compose(
    51   withSelect((select) => ({
    52     status: select('core/editor').getEditedPostAttribute('status'),
    53   })),
    54   withDispatch((dispatch) => ({
    55     onUpdate(status) {
    56       dispatch('core/editor').editPost( { status } );
    57       sideEffectL10nManipulation( getStatusLabel( status ) );
    58     }
    59   }))
    60 )(EditFlowCustomPostStati);
     92  withSelect( mapSelectToProps ),
     93  withDispatch( mapDispatchToProps )
     94)( EditFlowCustomPostStati );
    6195
    6296/**
  • edit-flow/tags/0.9.1/common/php/class-module.php

    r2010375 r2185823  
    2929
    3030    /**
     31     * Returns whether the current module is enabled.
     32     *
     33     * @since 0.9.1
     34     *
     35     * @return <code>true</code> if the module is enabled, <code>false</code> otherwise
     36     */
     37    public function is_enabled() {
     38        return $this->module->options->enabled === 'on';
     39    }
     40
     41    /**
    3142     * Returns whether the module with the given name is enabled.
    3243     *
     
    3950        global $edit_flow;
    4051
    41         return isset( $edit_flow->$slug ) && $edit_flow->$slug->module->options->enabled == 'on';
     52        return isset( $edit_flow->$slug ) && $edit_flow->$slug->is_enabled();
    4253    }
    4354
  • edit-flow/tags/0.9.1/common/php/trait-block-editor-compatible.php

    r2010360 r2185823  
    5050     */
    5151    function action_init_for_admin() {
     52        if ( ! $this->ef_module->is_enabled() ) {
     53            return;
     54        }
     55
    5256        $this->check_active_plugins();
    5357
  • edit-flow/tags/0.9.1/edit_flow.php

    r2010375 r2185823  
    55Description: Remixing the WordPress admin for better editorial workflow options.
    66Author: Daniel Bachhuber, Scott Bressler, Mohammad Jangda, Automattic, and others
    7 Version: 0.9
     7Version: 0.9.1
    88Author URI: http://editflow.org/
    99
     
    3636    ?>
    3737    <div class="notice notice-error">
    38             <p><?php esc_html_e( 'Edit Flow requires PHP 5.4+. Please contact your host to update your PHP version.', 'edit-flow' ); ?></p>
     38            <p><?php esc_html_e( 'Edit Flow requires PHP 5.6+. Please contact your host to update your PHP version.', 'edit-flow' ); ?></p>
    3939        </div>
    4040    <?php
    4141}
    4242
    43 if ( version_compare( phpversion(), '5.4', '<' ) ) {
     43if ( version_compare( phpversion(), '5.6', '<' ) ) {
    4444    add_action( 'admin_notices', '_ef_print_php_version_admin_notice' );
    4545    return;
     
    4747
    4848// Define contants
    49 define( 'EDIT_FLOW_VERSION' , '0.9' );
     49define( 'EDIT_FLOW_VERSION' , '0.9.1' );
    5050define( 'EDIT_FLOW_ROOT' , dirname(__FILE__) );
    5151define( 'EDIT_FLOW_FILE_PATH' , EDIT_FLOW_ROOT . '/' . basename(__FILE__) );
     
    9696
    9797    private function setup_globals() {
    98 
    9998        $this->modules = new stdClass();
    100 
     99        $this->modules_count = 0;
    101100    }
    102101
     
    297296        $this->modules->$name = (object) $args;
    298297
     298        $this->modules_count++;
     299
    299300        /**
    300301         * Fires after edit_flow has registered a module.
  • edit-flow/tags/0.9.1/modules/custom-status/compat/block-editor.php

    r2010360 r2185823  
    1111     */
    1212    function action_admin_enqueue_scripts() {
     13        if ( $this->ef_module->disable_custom_statuses_for_post_type() ) {
     14            return;
     15        }
     16
    1317        /**
    1418         * WP_Screen::is_block_editor only available in 5.0. If it's available and is false it's safe to say we should only pass through to the module.
     
    1620        if ( Block_Editor_Compatible::is_at_least_50() && ! get_current_screen()->is_block_editor() ) {
    1721            return $this->ef_module->action_admin_enqueue_scripts();
    18         }
    19 
    20         if ( $this->ef_module->disable_custom_statuses_for_post_type() ) {
    21             return;
    2222        }
    2323
  • edit-flow/tags/0.9.1/modules/custom-status/custom-status.php

    r2010375 r2185823  
    118118        add_filter( 'page_link', array( $this, 'fix_preview_link_part_two' ), 10, 3 );
    119119        add_filter( 'post_type_link', array( $this, 'fix_preview_link_part_two' ), 10, 3 );
     120        add_filter( 'preview_post_link', array( $this, 'fix_preview_link_part_three' ), 11, 2 );
    120121        add_filter( 'get_sample_permalink', array( $this, 'fix_get_sample_permalink' ), 10, 5 );
    121122        add_filter( 'get_sample_permalink_html', array( $this, 'fix_get_sample_permalink_html' ), 10, 5);
     
    282283            return false;
    283284
    284         if ( is_null( $post_type ) )
     285        if ( is_null( $post_type ) ) {
    285286            $post_type = $this->get_current_post_type();
    286 
    287         if ( $post_type && ! in_array( $post_type, $this->get_post_types_for_module( $this->module ) ) )
     287        }
     288
     289        if ( $post_type && ! in_array( $post_type, $this->get_post_types_for_module( $this->module ) ) ) {
    288290            return true;
     291        }
    289292
    290293        return false;
     
    300303        global $pagenow;
    301304
    302         if ( $this->disable_custom_statuses_for_post_type() )
     305        if ( $this->disable_custom_statuses_for_post_type() ) {
    303306            return;
     307        }
    304308
    305309        // Load Javascript we need to use on the configuration views (jQuery Sortable and Quick Edit)
     
    15001504
    15011505    /**
     1506     * Another hack! hack! hack! until core better supports custom statuses
     1507     *
     1508     * @since 0.9
     1509     *
     1510     * The preview link for a saved unpublished post with a custom status returns a 'preview_nonce'
     1511     * in it and needs to be removed when previewing it to return a viewable preview link.
     1512     * @see https://github.com/Automattic/Edit-Flow/issues/513
     1513     */
     1514    public function fix_preview_link_part_three( $preview_link, $query_args ) {
     1515        if ( $autosave = wp_get_post_autosave( $query_args->ID, $query_args->post_author ) ) {
     1516            foreach ( array_intersect( array_keys( _wp_post_revision_fields( $query_args ) ), array_keys( _wp_post_revision_fields( $autosave ) ) ) as $field ) {
     1517                if ( normalize_whitespace( $query_args->$field ) != normalize_whitespace( $autosave->$field ) ) {
     1518                    // Pass through, it's a personal preview.
     1519                    return $preview_link;
     1520                }
     1521           }
     1522        }
     1523        return remove_query_arg( [ 'preview_nonce' ], $preview_link ); 
     1524    }
     1525
     1526    /**
    15021527     * Fix get_sample_permalink. Previosuly the 'editable_slug' filter was leveraged
    15031528     * to correct the sample permalink a user could edit on post.php. Since 4.4.40
  • edit-flow/tags/0.9.1/modules/editorial-comments/lib/editorial-comments.js

    r2010375 r2185823  
    2424
    2525        // Watch for changes to the subscribed users.
    26         $( '#ef-post_following_box' ).on( 'following_list_updated', function() {
     26        jQuery( '#ef-post_following_box' ).on( 'following_list_updated', function() {
    2727            editorialCommentReply.notifiedMessage();
    2828        } );
     
    146146        subscribed_users.each( function() {         
    147147            // Add usernames of checked users to the list if they don't have a blocking class
    148             if ( ! $( this ).siblings().is( '.post_following_list-no_email,.post_following_list-no_access' ) && ! $( this ).hasClass( 'post_following_list-current_user' ) ) {
    149                 usernames.push( $( this ).parent().siblings( '.ef-user_displayname, .ef-usergroup_name' ).text() );
     148            if ( ! jQuery( this ).siblings().is( '.post_following_list-no_email,.post_following_list-no_access' ) && ! jQuery( this ).hasClass( 'post_following_list-current_user' ) ) {
     149                usernames.push( jQuery( this ).parent().siblings( '.ef-user_displayname, .ef-usergroup_name' ).text() );
    150150            }
    151151        } );
  • edit-flow/tags/0.9.1/modules/notifications/notifications.php

    r2010375 r2185823  
    421421
    422422        if ( 'ef-selected-users[]' === $_POST['ef_notifications_name'] ) {
     423            // Prevent auto-subscribing users that have opted out of notifications.
     424            add_filter( 'ef_notification_auto_subscribe_current_user', '__return_false', PHP_INT_MAX );
    423425            $this->save_post_following_users( $post, $user_group_ids );
    424426           
     
    447449                wp_send_json_success( $json_success );
    448450            }
     451            // Remove auto-subscribe prevention behavior from earlier.
     452            remove_filter( 'ef_notification_auto_subscribe_current_user', '__return_false', PHP_INT_MAX );
    449453        }
    450454       
  • edit-flow/tags/0.9.1/modules/settings/settings.php

    r2010375 r2185823  
    226226        <?php
    227227    }
    228    
     228
    229229    function print_modules() {
    230230        global $edit_flow;
    231        
    232         if ( !count( $edit_flow->modules ) ) {
     231
     232        if ( ! $edit_flow->modules_count ) {
    233233            echo '<div class="message error">' . __( 'There are no Edit Flow modules registered', 'edit-flow' ) . '</div>';
    234234        } else {
    235            
     235
    236236            foreach ( $edit_flow->modules as $mod_name => $mod_data ) {
    237237                if ( $mod_data->autoload )
    238238                    continue;
    239                
     239
    240240                $classes = array(
    241241                    'edit-flow-module',
  • edit-flow/tags/0.9.1/modules/user-groups/user-groups.php

    r2010375 r2185823  
    688688            return array( &$errors, $update, &$user );
    689689
    690         //Don't allow update of user groups from network
    691         if ( ( !is_null( get_current_screen() ) ) && ( get_current_screen()->is_network ) )
    692             return;
     690        // `get_current_screen()` is defined on most admin pages, but not all.
     691        if( function_exists( 'get_current_screen' ) ){
     692            //Don't allow update of user groups from network
     693            $screen = get_current_screen();
     694            if ( ! is_null( $screen ) && $screen->is_network ) {
     695                return;
     696            }
     697        }
    693698
    694699        if ( current_user_can( $this->manage_usergroups_cap ) && wp_verify_nonce( $_POST['ef_edit_profile_usergroups_nonce'], 'ef_edit_profile_usergroups_nonce' ) ) {
  • edit-flow/tags/0.9.1/readme.txt

    r2010375 r2185823  
    33Donate link: http://editflow.org/contribute/
    44Tags: edit flow, workflow, editorial, newsroom, management, journalism, post status, custom status, notifications, email, comments, editorial comments, usergroups, calendars, editorial calendar, story budget
    5 Requires at least: 4.5
    6 Requires PHP: 5.4
    7 Tested up to: 5.0.3
    8 Stable tag: 0.9
     5Requires at least: 5.1
     6Requires PHP: 5.6
     7Tested up to: 5.3
     8Stable tag: 0.9.1
    99
    1010Redefining your editorial workflow.
    1111
    1212== Description ==
    13 
    14 [![Build Status](https://travis-ci.org/Automattic/Edit-Flow.svg?branch=master)](https://travis-ci.org/Automattic/Edit-Flow)
    1513
    1614Edit Flow empowers you to collaborate with your editorial team inside WordPress. We've made it modular so you can customize it to your needs:
     
    4846All development happens on [GitHub](https://github.com/Automattic/Edit-Flow).
    4947
    50 For support questions, feedback and ideas, please use the [WordPress.org forums](http://wordpress.org/tags/edit-flow?forum_id=10), which we look at often. For everything else, say [hello@editflow.org](mailto:hello@editflow.org). 
     48For support questions, feedback and ideas, please use the [WordPress.org forums](http://wordpress.org/tags/edit-flow?forum_id=10), which we look at often. For everything else, say [hello@editflow.org](mailto:hello@editflow.org).
    5149
    5250== Screenshots ==
     
    6058== Upgrade Notice ==
    6159
    62 = 0.9 =
     60= 0.9.1 =
     61Bump PHP minimum to 5.6 to match WordPress core. Plus, various bug fixes.
     62
     63= 0.9 =
    6364Bump minimum version of PHP to 5.4. Start implementation of Block Editor compatible modules, various improvements and bugfixes.
    6465
     
    112113
    113114== Changelog ==
     115
     116= 0.9.1 (November 4, 2019)
     117* Bug fix: Prevent custom status from being reverted when using Gutenberg (https://github.com/Automattic/Edit-Flow/pull/521 -- props mikeyarce, batmoo)
     118* Bug fix: Don't break post previews when using custom statuses (https://github.com/Automattic/Edit-Flow/pull/515 -- props
     119rebeccahum)
     120* Bug fix: Don't auto-subscribe the current user when notification settings are changed (https://github.com/Automattic/Edit-Flow/pull/540 -- props dchymko, jerclarke, mikeyarce)
     121* Bug fix: prevent fatals when editing posts on the frontend via certain plugins (https://github.com/Automattic/Edit-Flow/pull/538 -- props kjohnson, dchymko)
     122* Bug fix: Don't break classic editor when custom statuses are disabled (https://github.com/Automattic/Edit-Flow/pull/537 -- props batmoo,  thesquaremedia)
     123* Bug fix: Prevent `count()` warning on PHP 7.2 (https://github.com/Automattic/Edit-Flow/pull/534 -- props batmoo, NeilWJames)
     124* Bug fix: Prevent multiple plugin entries on the plugins page (https://github.com/Automattic/Edit-Flow/pull/530 -- props batmoo, mboynes, joshbetz)
     125* Bug fix: jQuery compatibility issues (https://github.com/Automattic/Edit-Flow/pull/499 -- props jameslesliemiller)
     126* Dev: Fix Travis CI Tests (props dchymko)
     127* Bonus props to jerclarke, mikeyarce, rebeccahum, rinatkhaziev, dchymko, and batmoo for helping with issues/PRs/testing.
    114128
    115129= 0.9 (January 10, 2018) =
  • edit-flow/trunk/blocks/dist/custom-status.build.js

    r2010360 r2185823  
    1 !function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([,function(t,e,n){"use strict";n.r(e);n(5),n(6);var o=wp.i18n.__,r=wp.editPost.PluginPostStatusInfo,u=wp.plugins.registerPlugin,i=wp.data,l=i.withSelect,s=i.withDispatch,a=wp.compose.compose,c=wp.components.SelectControl,d=window.EditFlowCustomStatuses.map(function(t){return{label:t.name,value:t.slug}});u("edit-flow-custom-status",{icon:"edit-flow",render:a(l(function(t){return{status:t("core/editor").getEditedPostAttribute("status")}}),s(function(t){return{onUpdate:function(e){var n;t("core/editor").editPost({status:e}),function(t){document.querySelector(".editor-post-save-draft")&&(document.querySelector(".editor-post-save-draft").innerText="".concat(o("Save")," ").concat(t))}((n=e,d.find(function(t){return t.value===n}).label))}}}))(function(t){var e=t.onUpdate,n=t.status;return wp.element.createElement(r,{className:"edit-flow-extended-post-status edit-flow-extended-post-status-".concat(n)},wp.element.createElement("h4",null,o("publish"!==n?"Extended Post Status":"Extended Post Status Disabled.","edit-flow")),"publish"!==n?wp.element.createElement(c,{label:"",value:n,options:d,onChange:e}):null,wp.element.createElement("small",{className:"edit-flow-extended-post-status-note"},"publish"!==n?o("Note: this will override all status settings above.","edit-flow"):o("Please switch to draft first.")))})})},,,,function(t,e){},function(t,e){}]);
     1!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([,function(t,e,n){"use strict";n.r(e);n(5),n(6);var o=wp.i18n.__,r=wp.editPost.PluginPostStatusInfo,u=wp.plugins.registerPlugin,s=wp.data,i=s.subscribe,l=s.dispatch,a=s.select,c=s.withSelect,d=s.withDispatch,f=wp.compose.compose,p=wp.components.SelectControl,m=window.EditFlowCustomStatuses.map(function(t){return{label:t.name,value:t.slug}}),b=function(t){return m.find(function(e){return e.value===t}).label},w=function(t){document.querySelector(".editor-post-save-draft")&&(document.querySelector(".editor-post-save-draft").innerText="".concat(o("Save")))};i(function(){if(a("core/editor").getCurrentPostId())if(a("core/editor").isCleanNewPost())l("core/editor").editPost({status:ef_default_custom_status});else{var t=a("core/editor").getEditedPostAttribute("status");void 0!==t&&"publish"!==t&&w(b(t))}});u("edit-flow-custom-status",{icon:"edit-flow",render:f(c(function(t){return{status:t("core/editor").getEditedPostAttribute("status")}}),d(function(t){return{onUpdate:function(e){t("core/editor").editPost({status:e}),w(b(e))}}}))(function(t){var e=t.onUpdate,n=t.status;return wp.element.createElement(r,{className:"edit-flow-extended-post-status edit-flow-extended-post-status-".concat(n)},wp.element.createElement("h4",null,o("publish"!==n?"Extended Post Status":"Extended Post Status Disabled.","edit-flow")),"publish"!==n?wp.element.createElement(p,{label:"",value:n,options:m,onChange:e}):null,wp.element.createElement("small",{className:"edit-flow-extended-post-status-note"},o("publish"!==n?"Note: this will override all status settings above.":"To select a custom status, please unpublish the content first.","edit-flow")))})})},,,,function(t,e){},function(t,e){}]);
    22//# sourceMappingURL=custom-status.build.js.map
  • edit-flow/trunk/blocks/src/custom-status/block.js

    r2010360 r2185823  
    55let { PluginPostStatusInfo } = wp.editPost;
    66let { registerPlugin } = wp.plugins;
    7 let { withSelect, withDispatch } = wp.data;
     7let { subscribe, dispatch, select, withSelect, withDispatch } = wp.data;
    88let { compose } = wp.compose;
    99let { SelectControl } = wp.components;
     
    2121  let node = document.querySelector('.editor-post-save-draft');
    2222  if ( node ) {
    23     document.querySelector('.editor-post-save-draft').innerText = `${__( 'Save' ) } ${status}`
     23    document.querySelector( '.editor-post-save-draft' ).innerText = `${ __( 'Save' ) }`
    2424  }
    2525}
     26
     27// Set the status to the default custom status.
     28subscribe( function () {
     29  const postId = select( 'core/editor' ).getCurrentPostId();
     30  // Post isn't ready yet so don't do anything.
     31  if ( ! postId ) {
     32    return;
     33  }
     34
     35  // For new posts, we need to force the our default custom status.
     36  // Otherwise WordPress will force it to "Draft".
     37  const isCleanNewPost = select( 'core/editor' ).isCleanNewPost();
     38  if ( isCleanNewPost ) {
     39    dispatch( 'core/editor' ).editPost( {
     40      status: ef_default_custom_status
     41    } );
     42
     43    return;
     44  }
     45
     46  // Update the "Save" button.
     47  var status = select( 'core/editor' ).getEditedPostAttribute( 'status' );
     48  if ( typeof status !== 'undefined' && status !== 'publish' ) {
     49    sideEffectL10nManipulation( getStatusLabel( status ) );
     50  }
     51} );
    2652
    2753/**
     
    4874);
    4975
     76const mapSelectToProps = ( select ) => {
     77  return {
     78    status: select('core/editor').getEditedPostAttribute('status'),
     79  };
     80};
     81
     82const mapDispatchToProps = ( dispatch ) => {
     83  return {
     84    onUpdate( status ) {
     85      dispatch( 'core/editor' ).editPost( { status } );
     86      sideEffectL10nManipulation( getStatusLabel( status ) );
     87    },
     88  };
     89};
     90
    5091let plugin = compose(
    51   withSelect((select) => ({
    52     status: select('core/editor').getEditedPostAttribute('status'),
    53   })),
    54   withDispatch((dispatch) => ({
    55     onUpdate(status) {
    56       dispatch('core/editor').editPost( { status } );
    57       sideEffectL10nManipulation( getStatusLabel( status ) );
    58     }
    59   }))
    60 )(EditFlowCustomPostStati);
     92  withSelect( mapSelectToProps ),
     93  withDispatch( mapDispatchToProps )
     94)( EditFlowCustomPostStati );
    6195
    6296/**
  • edit-flow/trunk/common/php/class-module.php

    r2010375 r2185823  
    2929
    3030    /**
     31     * Returns whether the current module is enabled.
     32     *
     33     * @since 0.9.1
     34     *
     35     * @return <code>true</code> if the module is enabled, <code>false</code> otherwise
     36     */
     37    public function is_enabled() {
     38        return $this->module->options->enabled === 'on';
     39    }
     40
     41    /**
    3142     * Returns whether the module with the given name is enabled.
    3243     *
     
    3950        global $edit_flow;
    4051
    41         return isset( $edit_flow->$slug ) && $edit_flow->$slug->module->options->enabled == 'on';
     52        return isset( $edit_flow->$slug ) && $edit_flow->$slug->is_enabled();
    4253    }
    4354
  • edit-flow/trunk/common/php/trait-block-editor-compatible.php

    r2010360 r2185823  
    5050     */
    5151    function action_init_for_admin() {
     52        if ( ! $this->ef_module->is_enabled() ) {
     53            return;
     54        }
     55
    5256        $this->check_active_plugins();
    5357
  • edit-flow/trunk/edit_flow.php

    r2010375 r2185823  
    55Description: Remixing the WordPress admin for better editorial workflow options.
    66Author: Daniel Bachhuber, Scott Bressler, Mohammad Jangda, Automattic, and others
    7 Version: 0.9
     7Version: 0.9.1
    88Author URI: http://editflow.org/
    99
     
    3636    ?>
    3737    <div class="notice notice-error">
    38             <p><?php esc_html_e( 'Edit Flow requires PHP 5.4+. Please contact your host to update your PHP version.', 'edit-flow' ); ?></p>
     38            <p><?php esc_html_e( 'Edit Flow requires PHP 5.6+. Please contact your host to update your PHP version.', 'edit-flow' ); ?></p>
    3939        </div>
    4040    <?php
    4141}
    4242
    43 if ( version_compare( phpversion(), '5.4', '<' ) ) {
     43if ( version_compare( phpversion(), '5.6', '<' ) ) {
    4444    add_action( 'admin_notices', '_ef_print_php_version_admin_notice' );
    4545    return;
     
    4747
    4848// Define contants
    49 define( 'EDIT_FLOW_VERSION' , '0.9' );
     49define( 'EDIT_FLOW_VERSION' , '0.9.1' );
    5050define( 'EDIT_FLOW_ROOT' , dirname(__FILE__) );
    5151define( 'EDIT_FLOW_FILE_PATH' , EDIT_FLOW_ROOT . '/' . basename(__FILE__) );
     
    9696
    9797    private function setup_globals() {
    98 
    9998        $this->modules = new stdClass();
    100 
     99        $this->modules_count = 0;
    101100    }
    102101
     
    297296        $this->modules->$name = (object) $args;
    298297
     298        $this->modules_count++;
     299
    299300        /**
    300301         * Fires after edit_flow has registered a module.
  • edit-flow/trunk/modules/custom-status/compat/block-editor.php

    r2010360 r2185823  
    1111     */
    1212    function action_admin_enqueue_scripts() {
     13        if ( $this->ef_module->disable_custom_statuses_for_post_type() ) {
     14            return;
     15        }
     16
    1317        /**
    1418         * WP_Screen::is_block_editor only available in 5.0. If it's available and is false it's safe to say we should only pass through to the module.
     
    1620        if ( Block_Editor_Compatible::is_at_least_50() && ! get_current_screen()->is_block_editor() ) {
    1721            return $this->ef_module->action_admin_enqueue_scripts();
    18         }
    19 
    20         if ( $this->ef_module->disable_custom_statuses_for_post_type() ) {
    21             return;
    2222        }
    2323
  • edit-flow/trunk/modules/custom-status/custom-status.php

    r2010375 r2185823  
    118118        add_filter( 'page_link', array( $this, 'fix_preview_link_part_two' ), 10, 3 );
    119119        add_filter( 'post_type_link', array( $this, 'fix_preview_link_part_two' ), 10, 3 );
     120        add_filter( 'preview_post_link', array( $this, 'fix_preview_link_part_three' ), 11, 2 );
    120121        add_filter( 'get_sample_permalink', array( $this, 'fix_get_sample_permalink' ), 10, 5 );
    121122        add_filter( 'get_sample_permalink_html', array( $this, 'fix_get_sample_permalink_html' ), 10, 5);
     
    282283            return false;
    283284
    284         if ( is_null( $post_type ) )
     285        if ( is_null( $post_type ) ) {
    285286            $post_type = $this->get_current_post_type();
    286 
    287         if ( $post_type && ! in_array( $post_type, $this->get_post_types_for_module( $this->module ) ) )
     287        }
     288
     289        if ( $post_type && ! in_array( $post_type, $this->get_post_types_for_module( $this->module ) ) ) {
    288290            return true;
     291        }
    289292
    290293        return false;
     
    300303        global $pagenow;
    301304
    302         if ( $this->disable_custom_statuses_for_post_type() )
     305        if ( $this->disable_custom_statuses_for_post_type() ) {
    303306            return;
     307        }
    304308
    305309        // Load Javascript we need to use on the configuration views (jQuery Sortable and Quick Edit)
     
    15001504
    15011505    /**
     1506     * Another hack! hack! hack! until core better supports custom statuses
     1507     *
     1508     * @since 0.9
     1509     *
     1510     * The preview link for a saved unpublished post with a custom status returns a 'preview_nonce'
     1511     * in it and needs to be removed when previewing it to return a viewable preview link.
     1512     * @see https://github.com/Automattic/Edit-Flow/issues/513
     1513     */
     1514    public function fix_preview_link_part_three( $preview_link, $query_args ) {
     1515        if ( $autosave = wp_get_post_autosave( $query_args->ID, $query_args->post_author ) ) {
     1516            foreach ( array_intersect( array_keys( _wp_post_revision_fields( $query_args ) ), array_keys( _wp_post_revision_fields( $autosave ) ) ) as $field ) {
     1517                if ( normalize_whitespace( $query_args->$field ) != normalize_whitespace( $autosave->$field ) ) {
     1518                    // Pass through, it's a personal preview.
     1519                    return $preview_link;
     1520                }
     1521           }
     1522        }
     1523        return remove_query_arg( [ 'preview_nonce' ], $preview_link ); 
     1524    }
     1525
     1526    /**
    15021527     * Fix get_sample_permalink. Previosuly the 'editable_slug' filter was leveraged
    15031528     * to correct the sample permalink a user could edit on post.php. Since 4.4.40
  • edit-flow/trunk/modules/editorial-comments/lib/editorial-comments.js

    r2010375 r2185823  
    2424
    2525        // Watch for changes to the subscribed users.
    26         $( '#ef-post_following_box' ).on( 'following_list_updated', function() {
     26        jQuery( '#ef-post_following_box' ).on( 'following_list_updated', function() {
    2727            editorialCommentReply.notifiedMessage();
    2828        } );
     
    146146        subscribed_users.each( function() {         
    147147            // Add usernames of checked users to the list if they don't have a blocking class
    148             if ( ! $( this ).siblings().is( '.post_following_list-no_email,.post_following_list-no_access' ) && ! $( this ).hasClass( 'post_following_list-current_user' ) ) {
    149                 usernames.push( $( this ).parent().siblings( '.ef-user_displayname, .ef-usergroup_name' ).text() );
     148            if ( ! jQuery( this ).siblings().is( '.post_following_list-no_email,.post_following_list-no_access' ) && ! jQuery( this ).hasClass( 'post_following_list-current_user' ) ) {
     149                usernames.push( jQuery( this ).parent().siblings( '.ef-user_displayname, .ef-usergroup_name' ).text() );
    150150            }
    151151        } );
  • edit-flow/trunk/modules/notifications/notifications.php

    r2010375 r2185823  
    421421
    422422        if ( 'ef-selected-users[]' === $_POST['ef_notifications_name'] ) {
     423            // Prevent auto-subscribing users that have opted out of notifications.
     424            add_filter( 'ef_notification_auto_subscribe_current_user', '__return_false', PHP_INT_MAX );
    423425            $this->save_post_following_users( $post, $user_group_ids );
    424426           
     
    447449                wp_send_json_success( $json_success );
    448450            }
     451            // Remove auto-subscribe prevention behavior from earlier.
     452            remove_filter( 'ef_notification_auto_subscribe_current_user', '__return_false', PHP_INT_MAX );
    449453        }
    450454       
  • edit-flow/trunk/modules/settings/settings.php

    r2010375 r2185823  
    226226        <?php
    227227    }
    228    
     228
    229229    function print_modules() {
    230230        global $edit_flow;
    231        
    232         if ( !count( $edit_flow->modules ) ) {
     231
     232        if ( ! $edit_flow->modules_count ) {
    233233            echo '<div class="message error">' . __( 'There are no Edit Flow modules registered', 'edit-flow' ) . '</div>';
    234234        } else {
    235            
     235
    236236            foreach ( $edit_flow->modules as $mod_name => $mod_data ) {
    237237                if ( $mod_data->autoload )
    238238                    continue;
    239                
     239
    240240                $classes = array(
    241241                    'edit-flow-module',
  • edit-flow/trunk/modules/user-groups/user-groups.php

    r2010375 r2185823  
    688688            return array( &$errors, $update, &$user );
    689689
    690         //Don't allow update of user groups from network
    691         if ( ( !is_null( get_current_screen() ) ) && ( get_current_screen()->is_network ) )
    692             return;
     690        // `get_current_screen()` is defined on most admin pages, but not all.
     691        if( function_exists( 'get_current_screen' ) ){
     692            //Don't allow update of user groups from network
     693            $screen = get_current_screen();
     694            if ( ! is_null( $screen ) && $screen->is_network ) {
     695                return;
     696            }
     697        }
    693698
    694699        if ( current_user_can( $this->manage_usergroups_cap ) && wp_verify_nonce( $_POST['ef_edit_profile_usergroups_nonce'], 'ef_edit_profile_usergroups_nonce' ) ) {
  • edit-flow/trunk/readme.txt

    r2010375 r2185823  
    33Donate link: http://editflow.org/contribute/
    44Tags: edit flow, workflow, editorial, newsroom, management, journalism, post status, custom status, notifications, email, comments, editorial comments, usergroups, calendars, editorial calendar, story budget
    5 Requires at least: 4.5
    6 Requires PHP: 5.4
    7 Tested up to: 5.0.3
    8 Stable tag: 0.9
     5Requires at least: 5.1
     6Requires PHP: 5.6
     7Tested up to: 5.3
     8Stable tag: 0.9.1
    99
    1010Redefining your editorial workflow.
    1111
    1212== Description ==
    13 
    14 [![Build Status](https://travis-ci.org/Automattic/Edit-Flow.svg?branch=master)](https://travis-ci.org/Automattic/Edit-Flow)
    1513
    1614Edit Flow empowers you to collaborate with your editorial team inside WordPress. We've made it modular so you can customize it to your needs:
     
    4846All development happens on [GitHub](https://github.com/Automattic/Edit-Flow).
    4947
    50 For support questions, feedback and ideas, please use the [WordPress.org forums](http://wordpress.org/tags/edit-flow?forum_id=10), which we look at often. For everything else, say [hello@editflow.org](mailto:hello@editflow.org). 
     48For support questions, feedback and ideas, please use the [WordPress.org forums](http://wordpress.org/tags/edit-flow?forum_id=10), which we look at often. For everything else, say [hello@editflow.org](mailto:hello@editflow.org).
    5149
    5250== Screenshots ==
     
    6058== Upgrade Notice ==
    6159
    62 = 0.9 =
     60= 0.9.1 =
     61Bump PHP minimum to 5.6 to match WordPress core. Plus, various bug fixes.
     62
     63= 0.9 =
    6364Bump minimum version of PHP to 5.4. Start implementation of Block Editor compatible modules, various improvements and bugfixes.
    6465
     
    112113
    113114== Changelog ==
     115
     116= 0.9.1 (November 4, 2019)
     117* Bug fix: Prevent custom status from being reverted when using Gutenberg (https://github.com/Automattic/Edit-Flow/pull/521 -- props mikeyarce, batmoo)
     118* Bug fix: Don't break post previews when using custom statuses (https://github.com/Automattic/Edit-Flow/pull/515 -- props
     119rebeccahum)
     120* Bug fix: Don't auto-subscribe the current user when notification settings are changed (https://github.com/Automattic/Edit-Flow/pull/540 -- props dchymko, jerclarke, mikeyarce)
     121* Bug fix: prevent fatals when editing posts on the frontend via certain plugins (https://github.com/Automattic/Edit-Flow/pull/538 -- props kjohnson, dchymko)
     122* Bug fix: Don't break classic editor when custom statuses are disabled (https://github.com/Automattic/Edit-Flow/pull/537 -- props batmoo,  thesquaremedia)
     123* Bug fix: Prevent `count()` warning on PHP 7.2 (https://github.com/Automattic/Edit-Flow/pull/534 -- props batmoo, NeilWJames)
     124* Bug fix: Prevent multiple plugin entries on the plugins page (https://github.com/Automattic/Edit-Flow/pull/530 -- props batmoo, mboynes, joshbetz)
     125* Bug fix: jQuery compatibility issues (https://github.com/Automattic/Edit-Flow/pull/499 -- props jameslesliemiller)
     126* Dev: Fix Travis CI Tests (props dchymko)
     127* Bonus props to jerclarke, mikeyarce, rebeccahum, rinatkhaziev, dchymko, and batmoo for helping with issues/PRs/testing.
    114128
    115129= 0.9 (January 10, 2018) =
Note: See TracChangeset for help on using the changeset viewer.