WPIntell

Source evidence

Patch suggestion

Save and Close · support · 2014-01-03T03:14:00+00:00

complaintsentiment
highseverity
0.85relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 27 rows with source links

3.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
tysonlt unresolved
Hello! I have made a small little hack to suit a particular use case I have. I have a custom post type with a meta box that allows you to link to dependent posts. After saving the child post (I’m using Pods) then I want Save and Close to return to the parent edit form. I have made the following changes. I added a force param so that it would not interfere with existing functionality: function add_button() { ... <div id="major-publishing-actions" style="overflow:hidden"> <div id="publishing-action"> //////// BEGIN MOD //////// <input type="hidden" name="saveclose_referer_force" value="<?php echo $_REQUEST['saveclose_referer_force'] ?>"> //////// END MOD //////// <input type="hidden" name="saveclose_referer" value="<?php echo $_SERVER['HTTP_REFERER'] ?>"> <input type="submit" tabindex="5" value="<?php echo $button_label ?>" class="button-primary" id="custom" name="save-close"> </div> </div> ... } and function redirect() { ... wp_update_post(array('ID' => $_POST['post_ID'], 'post_status' => $post_status)); //////// BEGIN MOD //////// //has the calling page explicitly asked that we return to it? $force_referer = false; if (isset($_POST['saveclose_referer_force'])) { $force_referer = $_POST['saveclose_referer_force']; } // if we have an HTTP referer saved, and it's a post listing page (or referer explicitly set the force param), redirect back to that (maintains pagination, filters, etc.) if (isset($_POST['saveclose_referer']) && ($force_referer || strstr($_POST['saveclose_referer'], 'edit.php') !== false)) { //////// END MOD //////// ... } http://wordpress.org/plugins/lightbulb-save-and-close/

Comments

0 shown

No comments were stored for this source.