Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for custom fields

They were saved for each new post, not only for my custom post type
  • Loading branch information...
commit 393d619cd4611af2e919e2457a520966e26fc41d 1 parent ef582d3
@jeherve authored
Showing with 11 additions and 6 deletions.
  1. +4 −1 readme.txt
  2. +7 −5 wp-fb-applications.php
View
5 readme.txt
@@ -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
12 wp-fb-applications.php
@@ -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' );
Please sign in to comment.
Something went wrong with that request. Please try again.