diff --git a/README.md b/README.md index 02975fb1c..e74d84f37 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ Contributors: batmoo, danielbachhuber, sbressler, automattic Donate link: http://editflow.org/contribute/ Tags: edit flow, workflow, editorial, newsroom, management, journalism, post status, custom status, notifications, email, comments, editorial comments, usergroups, calendars, editorial calendar, story budget Requires at least: 4.5 -Tested up to: 4.6.1 -Stable tag: 0.8.2 +Tested up to: 4.9.6 +Stable tag: 0.8.3 Redefining your editorial workflow. @@ -56,6 +56,9 @@ For support questions, feedback and ideas, please use the [WordPress.org forums] ## Upgrade Notice +**0.8.3** +Improvements and bugfixes. + **0.8.2** Minor enhancements and bug fixes, translation updates. @@ -80,10 +83,10 @@ Contributors and other users without the 'publish_posts' capability can access c **0.7.1** Enhancements and bug fixes, including defaulting to the proper date in the calendar and an Italian localization. -**0.7** +**0.7** Complete rewrite into a modular architecture. Lots of polish added. Important note: If upgrading from pre-v0.6, please upgrade to v0.6.5 first -**0.6.5** +**0.6.5** Fixes an issue where the post timestamp would be set as soon as a custom status was used. **0.6.4** @@ -103,6 +106,18 @@ New features, including story budget and editorial metadata, a completely rewrit ## Changelog +**0.8.3 (June 14, 2018)** +* UI Improvement: Made primary buttons on Settings screen consistent with WordPress UI. Props [cojennin](https://github.com/cojennin). +* UI Improvement: Display who particularly was notified about an editorial comment. Props [goodguyry](https://github.com/goodguyry), [WPprodigy](https://github.com/WPprodigy) +* Improvement: Updated Russian translation and documentation. Props [achumakov](https://github.com/achumakov). +* Improvement: Eliminate a few cases of raw SQL queries in favor of `date_query`. Props [justnorris](https://github.com/justnorris). +* Improvement: Cache calendar items for each user individually to prevent potential cache pollution. Props [justnorris](https://github.com/justnorris). +* Improvement: various i18n updates. +* Improvement: Move ef_story_budget_posts_query_args filter down to allow overriding the date query in Story Budget module. +* Improvement: Limit results in Calendar to 200 per page, potentially saving from trouble on websites with large amount of content. +* Improvement: Don’t generate rewrite rules for notepad as they're unused. +* Improvement: Support modifying HTML output of a Calendar day via ef_pre_calendar_single_date_item_html filter. Props [cklosowski](https://github.com/cklosowski). + **0.8.2 (Sept. 16, 2016)** * Improvement: Updated Spanish localization thanks to [moucho](https://github.com/moucho) * Improvement: New Swedish localization thanks to [Warpsmith](https://github.com/Warpsmith) @@ -306,13 +321,13 @@ The following folks did some tremendous work helping with the release of Edit Fl * Added option to globally disable QuickPitch widget * Bug fix: Custom Status names cannot be longer than 20 chars * Bug fix: Deleted users are removed as subscribers from posts -* Bug fix: Blank menu items should now be sorta hidden +* Bug fix: Blank menu items should now be sorta hidden **0.2** * Custom Statuses are now supported for pages * Editorial Comments (with threading) * Email Notifications (on post status change and editorial comment) -* Additional Post metadata +* Additional Post metadata * Quick Pitch Dashboard widget * Bug fix: sorting issue on Manage Posts page (Mad props to David Smith from Columbia U.) * Other bug fixes diff --git a/edit_flow.php b/edit_flow.php index 57eb5639f..6e6024e32 100644 --- a/edit_flow.php +++ b/edit_flow.php @@ -4,7 +4,7 @@ Plugin URI: http://editflow.org/ Description: Remixing the WordPress admin for better editorial workflow options. Author: Daniel Bachhuber, Scott Bressler, Mohammad Jangda, Automattic, and others -Version: 0.8.2 +Version: 0.8.3 Author URI: http://editflow.org/ Copyright 2009-2016 Mohammad Jangda, Daniel Bachhuber, et al. @@ -28,7 +28,7 @@ */ // Define contants -define( 'EDIT_FLOW_VERSION' , '0.8.3-alpha' ); +define( 'EDIT_FLOW_VERSION' , '0.8.3' ); define( 'EDIT_FLOW_ROOT' , dirname(__FILE__) ); define( 'EDIT_FLOW_FILE_PATH' , EDIT_FLOW_ROOT . '/' . basename(__FILE__) ); define( 'EDIT_FLOW_URL' , plugins_url( '/', __FILE__ ) ); @@ -128,8 +128,12 @@ private function load_modules() { } } - // Supplementary plugins can hook into this, include their own modules - // and add them to the $edit_flow object + /** + * Fires after edit_flow has loaded all Edit Flow internal modules. + * + * Plugin authors can hook into this action, include their own modules add them to the $edit_flow object + * + */ do_action( 'ef_modules_loaded' ); } @@ -147,6 +151,13 @@ private function setup_actions() { add_action( 'admin_init', array( $this, 'action_admin_init' ) ); + /** + * Fires after setup of all edit_flow actions. + * + * Plugin authors can hook into this action to manipulate the edit_flow class after initial actions have been registered. + * + * @param edit_flow $this The core edit flow class + */ do_action_ref_array( 'editflow_after_setup_actions', array( &$this ) ); } @@ -169,6 +180,12 @@ function action_init() { if ( isset( $mod_data->options->enabled ) && $mod_data->options->enabled == 'on' ) $this->$mod_name->init(); + /** + * Fires after edit_flow has loaded all modules and module options. + * + * Plugin authors can hook into this action to trigger functionaltiy after all Edit Flow module's have been loaded. + * + */ do_action( 'ef_init' ); } @@ -248,6 +265,14 @@ public function register_module( $name, $args = array() ) { add_action( 'load-edit-flow_page_' . $args['settings_slug'], array( &$this->$name, 'action_settings_help_menu' ) ); $this->modules->$name = (object) $args; + + /** + * Fires after edit_flow has registered a module. + * + * Plugin authors can hook into this action to trigger functionaltiy after a module has been loaded. + * + * @param string $name The name of the registered module + */ do_action( 'ef_module_registered', $name ); return $this->modules->$name; } @@ -268,6 +293,13 @@ function load_module_options() { $this->$mod_name->module = $this->modules->$mod_name; } + + /** + * Fires after edit_flow has loaded all of the module options from the database. + * + * Plugin authors can hook into this action to read and manipulate module settings. + * + */ do_action( 'ef_module_options_loaded' ); } @@ -288,6 +320,9 @@ function action_init_after() { /** * Get a module by one of its descriptive values + * + * @param string $key The property to use for searching a module (ex: 'name') + * @param string|int|array $value The value to compare (using ==) */ function get_module_by( $key, $value ) { $module = false; diff --git a/modules/calendar/calendar.php b/modules/calendar/calendar.php index 666a2a0a4..e9b2f582b 100644 --- a/modules/calendar/calendar.php +++ b/modules/calendar/calendar.php @@ -85,13 +85,12 @@ function init() { // Define the create-post capability $this->create_post_cap = apply_filters( 'ef_calendar_create_post_cap', 'edit_posts' ); - - require_once( EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php' ); - add_screen_options_panel( self::usermeta_key_prefix . 'screen_options', __( 'Calendar Options', 'edit-flow' ), array( $this, 'generate_screen_options' ), self::screen_id, false, true ); + + add_action( 'admin_init', array( $this, 'add_screen_options_panel' ) ); add_action( 'admin_init', array( $this, 'handle_save_screen_options' ) ); add_action( 'admin_init', array( $this, 'register_settings' ) ); - add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); + add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); add_action( 'admin_print_styles', array( $this, 'add_admin_styles' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) ); @@ -244,6 +243,16 @@ function generate_screen_options() { return $output; } + /** + * Add module options to the screen panel + * + * @since 0.8.3 + */ + function add_screen_options_panel() { + require_once( EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php' ); + add_screen_options_panel( self::usermeta_key_prefix . 'screen_options', __( 'Calendar Options', 'edit-flow' ), array( $this, 'generate_screen_options' ), self::screen_id, false, true ); + } + /** * Handle the request to save the screen options * @@ -782,10 +791,14 @@ function view_calendar() { $this->hidden = 0; if ( !empty( $week_posts[$week_single_date] ) ) { - $week_posts[$week_single_date] = apply_filters( 'ef_calendar_posts_for_week', $week_posts[$week_single_date] ); + $week_posts[$week_single_date] = apply_filters( 'ef_calendar_posts_for_week', $week_posts[$week_single_date], $week_single_date ); - foreach ( $week_posts[$week_single_date] as $num => $post ){ - echo $this->generate_post_li_html( $post, $week_single_date, $num ); + foreach ( $week_posts[$week_single_date] as $num => $post ) { + $output = apply_filters( 'ef_pre_calendar_single_date_item_html', '', $this, $num, $post, $week_single_date ); + if ( ! $output ) { + $output = $this->generate_post_li_html( $post, $week_single_date, $num ); + } + echo $output; } } @@ -1297,23 +1310,23 @@ function get_pagination_link( $direction = 'next', $filters = array(), $weeks_of /** * Given a day in string format, returns the day at the beginning of that week, which can be the given date. - * The end of the week is determined by the blog option, 'start_of_week'. + * The beginning of the week is determined by the blog option, 'start_of_week'. * * @see http://www.php.net/manual/en/datetime.formats.date.php for valid date formats * * @param string $date String representing a date - * @param string $format Date format in which the end of the week should be returned + * @param string $format Date format in which the beginning of the week should be returned * @param int $week Number of weeks we're offsetting the range - * @return string $formatted_start_of_week End of the week + * @return string $formatted_start_of_week Beginning of the week */ function get_beginning_of_week( $date, $format = 'Y-m-d', $week = 1 ) { $date = strtotime( $date ); $start_of_week = get_option( 'start_of_week' ); $day_of_week = date( 'w', $date ); - $date += (( $start_of_week - $day_of_week - 7 ) % 7) * 60 * 60 * 24 * $week; - $additional = 3600 * 24 * 7 * ( $week - 1 ); - $formatted_start_of_week = date( $format, $date + $additional ); + $date += (( $start_of_week - $day_of_week - 7 ) % 7) * 60 * 60 * 24 ; + $date = strtotime ( '+' . ( $week - 1 ) . ' week', $date ) ; + $formatted_start_of_week = date( $format, $date ); return $formatted_start_of_week; } @@ -1335,8 +1348,8 @@ function get_ending_of_week( $date, $format = 'Y-m-d', $week = 1 ) { $end_of_week = get_option( 'start_of_week' ) - 1; $day_of_week = date( 'w', $date ); $date += (( $end_of_week - $day_of_week + 7 ) % 7) * 60 * 60 * 24; - $additional = 3600 * 24 * 7 * ( $week - 1 ); - $formatted_end_of_week = date( $format, $date + $additional ); + $date = strtotime ( '+' . ( $week - 1 ) . ' week', $date ) ; + $formatted_end_of_week = date( $format, $date ); return $formatted_end_of_week; } diff --git a/modules/custom-status/custom-status.php b/modules/custom-status/custom-status.php index 8569dd3a7..ed20665d2 100644 --- a/modules/custom-status/custom-status.php +++ b/modules/custom-status/custom-status.php @@ -1695,7 +1695,7 @@ private function get_preview_link( $post ) { } $args['preview_id'] = $post->ID; - return add_query_arg( $args, home_url() ); + return add_query_arg( $args, home_url( '/' ) ); } /** @@ -1735,7 +1735,7 @@ public function fix_post_row_actions( $actions, $post ) { ); } $args['preview'] = 'true'; - $preview_link = add_query_arg( $args, home_url() ); + $preview_link = add_query_arg( $args, home_url( '/' ) ); $actions['view'] = '' . __( 'Preview' ) . ''; return $actions; diff --git a/modules/dashboard/widgets/dashboard-notepad.php b/modules/dashboard/widgets/dashboard-notepad.php index 3ee25bae2..b61ced0f0 100644 --- a/modules/dashboard/widgets/dashboard-notepad.php +++ b/modules/dashboard/widgets/dashboard-notepad.php @@ -35,7 +35,7 @@ public function handle_notepad_update() { global $pagenow; if ( 'index.php' != $pagenow - || ( empty( $_REQUEST['action'] ) || 'dashboard-notepad' != $_REQUEST['action'] ) ) + || ( empty( $_POST['action'] ) || 'dashboard-notepad' != $_POST['action'] ) ) return; check_admin_referer( 'dashboard-notepad' ); @@ -43,25 +43,22 @@ public function handle_notepad_update() { if ( ! current_user_can( $this->edit_cap ) ) wp_die( EditFlow()->dashboard->messages['invalid-permissions'] ); - $current_id = (int)$_REQUEST['notepad-id']; + $current_id = (int) $_POST['notepad-id']; $current_notepad = get_post( $current_id ); $new_note = array( - 'post_content' => wp_filter_nohtml_kses( $_REQUEST['note'] ), + 'post_content' => wp_filter_nohtml_kses( $_POST['note'] ), 'post_type' => self::notepad_post_type, 'post_status' => 'draft', 'post_author' => get_current_user_id(), ); if ( $current_notepad && self::notepad_post_type == $current_notepad->post_type - && ! isset ( $_REQUEST['create-note'] ) ) { + && ! isset ( $_POST['create-note'] ) ) { $new_note['ID'] = $current_id; wp_update_post( $new_note ); } else { wp_insert_post( $new_note ); } - - wp_safe_redirect( wp_get_referer() ); - exit; } /** @@ -83,12 +80,12 @@ public function notepad_widget() { $current_post = ( ! empty( $posts[0] ) ) ? $posts[0] : false; if ( $current_post ) - $last_updated = '' . sprintf( __( '%1$s last updated on %2$s', 'edit-flow' ), get_user_by( 'id', $current_post->post_author )->display_name, get_the_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $current_post ) ) . ''; + $last_updated = '' . sprintf( __( '%1$s last updated on %2$s', 'edit-flow' ), get_user_by( 'id', $current_post->post_author )->display_name, get_the_modified_time( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $current_post ) ) . ''; else $last_updated = ''; if ( current_user_can( $this->edit_cap ) ) { - echo '