WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #25023


Ignore:
Timestamp:
08/13/2013 05:20:37 PM (5 years ago)
Author:
helen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25023 – Description

    initial v1  
    55The main concern is that the data is there until you edit, when you edit (and do not save) it deletes.
    66
     7{{{
    78/* #######################################################################
    89
     
    1112####################################################################### */
    1213
    13         function page_summary_init(){
    14                         add_meta_box("page_summary-meta", __("Enter the page summary" , "textdomain"), "page_summary_meta_options", "page", "normal", "high");
    15                         add_meta_box("page_summary-meta", __("Enter the page summary" , "textdomain"), "page_summary_meta_options", "case_study", "normal", "high");
     14function page_summary_init(){
     15        add_meta_box("page_summary-meta", __("Enter the page summary" , "textdomain"), "page_summary_meta_options", "page", "normal", "high");
     16        add_meta_box("page_summary-meta", __("Enter the page summary" , "textdomain"), "page_summary_meta_options", "case_study", "normal", "high");
     17}
     18
     19function page_summary_meta_options(){
     20        global $post;
     21        $custom = get_post_custom($post->ID);
     22
     23        $page_summary = "";
     24               
     25        if( isset( $custom["page_summary"] ) ) {
     26                $page_summary = $custom["page_summary"][0];
    1627        }
    17 
    18         function page_summary_meta_options(){
    19                 global $post;
    20                 $custom = get_post_custom($post->ID);
    21 
    22                 $page_summary = "";
    23                
    24                 if( isset( $custom["page_summary"] ) ) {
    25                         $page_summary = $custom["page_summary"][0];
    26                 }
    2728
    2829?>
     
    3233        </div>
    3334<?php
    34         }
     35}
    3536
    3637function save_page_summary_meta(){
     
    4950add_action("admin_init", "page_summary_init");
    5051add_action('save_post', 'save_page_summary_meta');
     52}}}