Changeset 696809
- Timestamp:
- 04/12/2013 10:53:55 PM (13 years ago)
- Location:
- lightbulb-save-and-close/trunk
- Files:
-
- 2 edited
-
lightbulb-save-and-close.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lightbulb-save-and-close/trunk/lightbulb-save-and-close.php
r696790 r696809 5 5 * Plugin URI: http://lightbulbdigital.com.au/wordpress-plugins 6 6 * Description: Adds a button to the Edit Post page which saves the post and redirects back to the post listing page. 7 * Version: 1. 17 * Version: 1.2 8 8 * Author: Lightbulb Digital 9 9 * Author URI: http://lightbulbdigital.com.au … … 22 22 add_action('post_submitbox_misc_actions', array('lb_save_close', 'add_button')); // add button 23 23 add_filter('redirect_post_location', array('lb_save_close', 'redirect'), '99'); // change redirect URL 24 add_action('admin_notices', array('lb_save_close', 'saved_notice')); 24 25 } 25 26 … … 73 74 // if we have an HTTP referer saved, and it's a post listing page, redirect back to that (maintains pagination, filters, etc.) 74 75 if (isset($_POST['saveclose_referer']) && strstr($_POST['saveclose_referer'], 'edit.php') !== false) { 76 if (strstr($_POST['saveclose_referer'], 'lbsmessage') === false) { 77 return $_POST['saveclose_referer'] . '&lbsmessage=1'; 78 } 75 79 return $_POST['saveclose_referer']; 76 80 } 77 81 // no referer saved, just redirect back to the main post listing page for the post type 78 82 else { 79 return get_admin_url() . 'edit.php?message=1&post_type=' . $_POST['post_type']; 83 return get_admin_url() . 'edit.php?lbsmessage=1&post_type=' . $_POST['post_type']; 84 } 85 } 86 87 /** 88 * Display a notice on the post listing page to inform the user that a post was saved 89 */ 90 public static function saved_notice() { 91 if (isset($_GET['lbsmessage'])) { 92 ?> 93 <div class="updated"> 94 <p>Post saved</p> 95 </div> 96 <?php 80 97 } 81 98 } -
lightbulb-save-and-close/trunk/readme.txt
r696790 r696809 5 5 Requires at least: 3.3 6 6 Tested up to: 3.5.1 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 40 40 * Allow post status to be changed to draft/pending when updating 41 41 * Redirect back to previous post listing URL (to maintain filters and pagination) 42 43 = 1.2 = 44 * Show notification when a post is saved
Note: See TracChangeset
for help on using the changeset viewer.