Plugin Directory

Changeset 603576


Ignore:
Timestamp:
09/25/2012 12:02:00 PM (14 years ago)
Author:
phill_brown
Message:

post_updated_messages added and condition examples jargon standardised.

Location:
menu-rules/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • menu-rules/trunk/admin/admin.php

    r603357 r603576  
    1515        PB_Framework::load( array( 'meta-box', 'forms' ) );
    1616
    17         add_action( 'init', __CLASS__ . '::init' );
     17        add_action( 'admin_init', __CLASS__ . '::init' );
    1818
    1919        add_action( 'admin_print_styles-post.php', __CLASS__ . '::styles' );
     
    2222        add_action( 'admin_print_scripts-post.php', __CLASS__ . '::scripts' );
    2323        add_action( 'admin_print_scripts-post-new.php', __CLASS__ . '::scripts' );
     24
     25        add_filter( 'post_updated_messages', __CLASS__ . '::post_updated_messages' );
    2426    }
    2527
    26     // On init
     28    // On admin_init
    2729    static function init() {
    2830
     
    6264        add_meta_box( 'menu-rules-reactions', __( 'Reactions', 'menu-rules' ), array( &Menu_Rules_Admin::$meta_box_reactions, 'display' ), Menu_Rules::get_var( 'post_type' ), 'normal' );
    6365    }
     66
     67    static function post_updated_messages( $messages ) {
     68        global $post, $post_ID;
     69   
     70        $messages[ Menu_Rules::get_var( 'post_type' ) ] = array(
     71            0 => '',
     72            1 => __( 'Menu rule updated.', 'menu-rules' ),
     73            2 => __( 'Custom field updated.', 'menu-rules' ),
     74            3 => __( 'Custom field deleted.', 'menu-rules' ),
     75            4 => __( 'Menu rule updated.', 'menu-rules' ),
     76            5 => isset($_GET['revision']) ? sprintf( __( 'Menu rule restored to revision from %s', 'menu-rules' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
     77            6 => __( 'Menu rule published.', 'menu-rules' ),
     78            7 => __( 'Menu rule saved.', 'menu-rules' ),
     79            8 => __( 'Menu rule submitted.', 'menu-rules' ),
     80            9 => __( 'Menu rule scheduled for.', 'menu-rules' ),
     81            10 => __( 'Menu rule draft updated.', 'menu-rules' ),
     82        );
     83   
     84        return $messages;
     85    }
    6486}
  • menu-rules/trunk/admin/meta-box-conditions.php

    r603357 r603576  
    2626                'footer' => '
    2727                    <h4>' . __( 'Examples', 'menu-rules' ) . '</h4>
    28                     <p>' . sprintf( __( '%sis_single()%s applies rules when viewing a single post.', 'menu-rules' ), '<code>', '</code>' ) . '</p>
    29                     <p>' . sprintf( __( '%sis_singular( \'product\' )%s applies rules when viewing a single product.', 'menu-rules' ), '<code>', '</code>' ) . '</p>
    30                     <p>' . sprintf( __( '%s( is_singular( \'book\' ) || is_singular( \'journal\' ) ) && has_tag( \'fiction\' )%s applies rules when showing a single book or journal which is tagged as fiction', 'menu-rules' ), '<code>', '</code>' ) . '</p>
    31                     <p>' . sprintf( __( '%sis_user_logged_in()%s applies rules if the current user is logged in.', 'menu-rules' ), '<code>', '</code>' ) . '</p>
     28                    <p>' . sprintf( __( '%sis_single()%s applies reactions when viewing a single post.', 'menu-rules' ), '<code>', '</code>' ) . '</p>
     29                    <p>' . sprintf( __( '%sis_singular( \'product\' )%s applies reactions when viewing a single product.', 'menu-rules' ), '<code>', '</code>' ) . '</p>
     30                    <p>' . sprintf( __( '%s( is_singular( \'book\' ) || is_singular( \'journal\' ) ) && has_tag( \'fiction\' )%s applies reactions when showing a single book or journal which is tagged as fiction', 'menu-rules' ), '<code>', '</code>' ) . '</p>
     31                    <p>' . sprintf( __( '%sis_user_logged_in()%s applies reactions if the current user is logged in.', 'menu-rules' ), '<code>', '</code>' ) . '</p>
    3232                ',
    3333            ),
  • menu-rules/trunk/readme.txt

    r603355 r603576  
    5656* Bugfix where frontend assets weren't being loaded when on a new menu rule
    5757* Bugfix in meta box get_fields()
     58* Bugfix for post updated messages
    5859
    5960**Note:** Some stylesheets and Javascript files have had their handles changed.
Note: See TracChangeset for help on using the changeset viewer.