Plugin Directory

Changeset 1226592


Ignore:
Timestamp:
08/20/2015 10:12:47 PM (11 years ago)
Author:
RylanH
Message:

Hide admin notices on editor, provide quick link to get back to metadata editing in normal editor from Storyform editor, fix link when removing storyform

Location:
storyform/trunk
Files:
5 edited

Legend:

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

    r1225646 r1226592  
    1919        add_action( 'wp_ajax_storyform_delete_post', array( $this, 'storyform_delete_post' ) );
    2020        add_action( 'wp_ajax_storyform_get_post_types', array( $this, 'storyform_get_post_types' ) );   
    21         add_action( 'wp_ajax_storyform_get_media_sizes', array( $this, 'storyform_get_media_sizes' ) );
     21        add_action( 'wp_ajax_storyform_get_media_sizes', array( $this, 'storyform_get_media_sizes' ) );
     22        add_action( 'wp_ajax_storyform_redirect_admin_edit', array( $this, 'storyform_redirect_admin_edit' ) );
     23           
    2224       
    2325    }
     
    5355            $post_id = intval( $_GET['post'] );
    5456            Storyform_Options::get_instance()->update_template_for_post( $post_id, null ); 
    55             wp_redirect( get_edit_post_link( $post_id ) );
     57            wp_redirect( get_edit_post_link( $post_id, '&' ) );
    5658        }
    5759
     
    342344    }
    343345
     346    public function storyform_redirect_admin_edit(){
     347        check_ajax_referer( 'storyform-post-nonce' );
     348        $id = sanitize_text_field( $_POST['id'] );
     349
     350        $array = array(
     351            'url' => get_edit_post_link( $id, '&' )
     352        );
     353       
     354
     355        echo json_encode( $array );
     356        die();
     357    }
     358
    344359}
  • storyform/trunk/editor/editor.css

    r1225531 r1226592  
    1717    padding-bottom: 0;
    1818}
     19
     20#storyform-editor {
     21    position: absolute;
     22    top: 0;
     23    left: 0;
     24    background-color: #FFF;
     25}
  • storyform/trunk/editor/editor.js

    r1225531 r1226592  
    27432743});
    27442744
     2745WindowMessageManager.addEventListener("redirect-admin-edit", function (ev) {
     2746    var req = ev.detail.data;
     2747    jQuery.post(ajaxurl, {
     2748        action: "storyform_redirect_admin_edit",
     2749        _ajax_nonce: storyform_nonce,
     2750        id: req.id
     2751    }, function (data, textStatus, jqXHR) {
     2752        data = JSON.parse(data);
     2753        document.location.href = data.url;
     2754    });
     2755});
     2756
    27452757WindowMessageManager.addEventListener("get-post-types", function (ev) {
    27462758    var data = ev.detail.data;
  • storyform/trunk/src/js/editor.js

    r1225531 r1226592  
    104104    document.location.href = data.url;
    105105});
     106
     107WindowMessageManager.addEventListener('redirect-admin-edit', function(ev){
     108    var req = ev.detail.data;
     109    jQuery.post(ajaxurl, {
     110        action : 'storyform_redirect_admin_edit',
     111        _ajax_nonce: storyform_nonce,
     112        id: req.id
     113    }, function(data, textStatus, jqXHR){
     114        data = JSON.parse(data);
     115        document.location.href = data.url;
     116    });
     117});
     118
    106119
    107120WindowMessageManager.addEventListener('get-post-types', function(ev){
  • storyform/trunk/storyform.php

    r1225531 r1226592  
    55Plugin Name:  Storyform
    66Plugin URI:   http://storyform.co/docs/wordpress
    7 Version:      0.5.6
     7Version:      0.5.7
    88Description:  Plugin to enable Storyform on select posts. Works with both SEO and non-SEO permalinks.
    99Author:       Storyform
     
    1313
    1414global $storyform_version;
    15 $storyform_version = '0.5.6';
     15$storyform_version = '0.5.7';
    1616
    1717require_once( dirname( __FILE__ ) . '/config.php');
Note: See TracChangeset for help on using the changeset viewer.