From e0263e117b747903801f915e82960ab17e0b6307 Mon Sep 17 00:00:00 2001 From: Nikolai Kristiansen Date: Sun, 20 Nov 2011 20:22:07 +0100 Subject: [PATCH] Rename to from society to association --- ...s-admin.php => neuf-associations-admin.php | 32 ++++++++--------- ...ype.php => neuf-associations-post-type.php | 36 +++++++++---------- neuf-associations.php | 23 ++++++++++++ neuf-societies.php | 23 ------------ 4 files changed, 57 insertions(+), 57 deletions(-) rename neuf-societies-admin.php => neuf-associations-admin.php (57%) rename neuf-societies-post-type.php => neuf-associations-post-type.php (51%) create mode 100644 neuf-associations.php delete mode 100644 neuf-societies.php diff --git a/neuf-societies-admin.php b/neuf-associations-admin.php similarity index 57% rename from neuf-societies-admin.php rename to neuf-associations-admin.php index a7f95e7..ebe1251 100644 --- a/neuf-societies-admin.php +++ b/neuf-associations-admin.php @@ -1,6 +1,6 @@ '', 'title' => __( 'Forening', 'trans' ), @@ -12,13 +12,13 @@ function neuf_societies_change_columns( $cols ) { ); return $custom_cols; } -add_filter( "manage_society_posts_columns", "neuf_societies_change_columns" ); +add_filter( "manage_association_posts_columns", "neuf_associations_change_columns" ); // Add values to the custom columns -function neuf_societies_custom_columns( $column, $post_id ) { +function neuf_associations_custom_columns( $column, $post_id ) { switch ( $column ) { case "homepage": - $homepage = get_post_meta( $post_id, '_neuf_societies_homepage', true ); + $homepage = get_post_meta( $post_id, '_neuf_associations_homepage', true ); // default to permalink if not set $homepage = $homepage ? $homepage : get_permalink( $post_id ); echo ''.$homepage.''; @@ -30,10 +30,10 @@ function neuf_societies_custom_columns( $column, $post_id ) { break; } } -add_action( "manage_posts_custom_column" , "neuf_societies_custom_columns", 10, 2 ); +add_action( "manage_posts_custom_column" , "neuf_associations_custom_columns", 10, 2 ); // Make these columns sortable -function neuf_societies_sortable_columns( $cols ) { +function neuf_associations_sortable_columns( $cols ) { /*$custom_cols = array( 'starttime' => 'starttime', 'endtime' => 'endtime', @@ -42,30 +42,30 @@ function neuf_societies_sortable_columns( $cols ) { );*/ return $cols; } -add_filter( "manage_edit-society_sortable_columns", "neuf_societies_sortable_columns" ); +add_filter( "manage_edit-association_sortable_columns", "neuf_associations_sortable_columns" ); /* Add metaboxes (with styles) */ -function add_societies_metaboxes() { +function add_associations_metaboxes() { add_meta_box( - 'neuf_societies_div', + 'neuf_associations_div', __('Foreningsinformasjon'), - 'neuf_societies_div', - 'society', + 'neuf_associations_div', + 'association', 'side' ); } /* Metabox with additional info. */ -function neuf_societies_div(){ +function neuf_associations_div(){ global $post; - $society_homepage = get_post_meta( $post->ID, '_neuf_societies_homepage', true ); + $association_homepage = get_post_meta( $post->ID, '_neuf_associations_homepage', true ); ?>
- - " /> - + + " /> +
__( 'Societies' ), - 'singular_name' => __( 'Society' ), - 'add_new' => __( 'Add New Society' ), - 'add_new_item' => __( 'Add New Society' ), - 'edit_item' => __( 'Edit Society' ), - 'new_item' => __( 'Add New Society' ), - 'view_item' => __( 'View Society' ), - 'search_items' => __( 'Search Societies' ), - 'not_found' => __( 'No societies found' ), - 'not_found_in_trash' => __( 'No societies found in trash' ) + 'name' => __( 'Associations' ), + 'singular_name' => __( 'Association' ), + 'add_new' => __( 'Add New Association' ), + 'add_new_item' => __( 'Add New Association' ), + 'edit_item' => __( 'Edit Association' ), + 'new_item' => __( 'Add New Association' ), + 'view_item' => __( 'View Association' ), + 'search_items' => __( 'Search Associations' ), + 'not_found' => __( 'No associations found' ), + 'not_found_in_trash' => __( 'No associations found in trash' ) ); register_post_type( - 'society', + 'association', array( 'labels' => $labels, 'menu_position' => 5, 'public' => true, 'publicly_queryable' => true, - 'query_var' => 'society', + 'query_var' => 'association', 'show_ui' => true, 'capability_type' => 'post', 'supports' => array( @@ -34,13 +34,13 @@ function neuf_societies_post_type() { 'administrator', 'custom-fields' ), - 'register_meta_box_cb' => 'add_societies_metaboxes', + 'register_meta_box_cb' => 'add_associations_metaboxes', ) ); } /* When the post is saved, saves our custom data */ -function neuf_societies_save_postdata( $post_id ) { +function neuf_associations_save_postdata( $post_id ) { // verify if this is an auto save routine. // If it is our form has not been submitted, so we dont want to do anything if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) @@ -49,7 +49,7 @@ function neuf_societies_save_postdata( $post_id ) { // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times - if ( empty($_POST) || !wp_verify_nonce( $_POST['neuf_societies_nonce'], 'neuf_societies_nonce' ) ) + if ( empty($_POST) || !wp_verify_nonce( $_POST['neuf_associations_nonce'], 'neuf_associations_nonce' ) ) return; // Check permissions @@ -66,11 +66,11 @@ function neuf_societies_save_postdata( $post_id ) { // OK, we're authenticated. // prefix with protocol if not present - $mydata = esc_url( $_POST['_neuf_societies_homepage'] ); + $mydata = esc_url( $_POST['_neuf_associations_homepage'] ); // Do something with $mydata // probably using add_post_meta(), update_post_meta(), or // a custom table (see Further Reading section below) - update_post_meta($post_id, '_neuf_societies_homepage', $mydata); + update_post_meta($post_id, '_neuf_associations_homepage', $mydata); } ?> diff --git a/neuf-associations.php b/neuf-associations.php new file mode 100644 index 0000000..f06f226 --- /dev/null +++ b/neuf-associations.php @@ -0,0 +1,23 @@ + diff --git a/neuf-societies.php b/neuf-societies.php deleted file mode 100644 index 5fe70ae..0000000 --- a/neuf-societies.php +++ /dev/null @@ -1,23 +0,0 @@ -