Permalink
Browse files

Fix for custom fields

They were saved for each new post, not only for my custom post type
  • Loading branch information...
1 parent ef582d3 commit 393d619cd4611af2e919e2457a520966e26fc41d @jeherve committed Dec 5, 2011
Showing with 11 additions and 6 deletions.
  1. +4 −1 readme.txt
  2. +7 −5 wp-fb-applications.php
View
@@ -4,7 +4,7 @@ Donate link: http://jeremy.tagada.hu
Tags: facebook, application, campaign, tab, custom post type, custom fields
Requires at least: 3.0
Tested up to: 3.3
-Stable tag: 0.4.3
+Stable tag: 0.4.4
Create custom tabs for your Facebook pages, hosted on your WordPress blog.
@@ -62,6 +62,9 @@ When viewing your [application settings page](http://www.facebook.com/developers
== Changelog ==
+= 0.4.4 =
+* Save Facebook App settings only for the plugin tabs, not for other custom post types
+
= 0.4.3 =
* Fix styling issue on admin page with WordPress 3.3
View
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: WP-Facebook applications
-Version: 0.4.3
+Version: 0.4.4
Plugin URI: http://www.werewp.com/my-plugins/wp-facebook-applications/
Description: Create custom tabs for your Facebook pages, hosted on your WordPress blog.
Author: Jeremy Herve
@@ -129,10 +129,12 @@ function werewp_fbappappparameters() {
function werewp_save_details(){
global $post;
-
- update_post_meta($post->ID, 'appid', $_POST['appid']);
- update_post_meta($post->ID, 'appsecret', $_POST['appsecret']);
- update_post_meta($post->ID, 'fbcomments', $_POST['fbcomments']);
+
+ if ( $post->post_type == 'werewp_fbapp' ) {
+ update_post_meta($post->ID, 'appid', $_POST['appid']);
+ update_post_meta($post->ID, 'appsecret', $_POST['appsecret']);
+ update_post_meta($post->ID, 'fbcomments', $_POST['fbcomments']);
+ }
}
add_action( 'save_post', 'werewp_save_details' );

0 comments on commit 393d619

Please sign in to comment.