WP Embed Facebook - Version 2.0.3

Version Description

  • Fixed notice on pages and events with no cover
  • Moved admin scripts to footer
Download this release

Release Info

Developer poxtron
Plugin Icon 128x128 WP Embed Facebook
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

lib/admin/admin.js DELETED
@@ -1,19 +0,0 @@
1
- jQuery(document).ready(function ($) {
2
- if (pagenow == 'settings_page_embedfacebook') {
3
- var sections = $('section');
4
- sections.first().show();
5
- $(".nav-tab-wrapper a").on('click', function (event) {
6
- event.preventDefault();
7
- sections.hide();
8
- $.each($(".nav-tab-wrapper a"), function (key, value) {
9
- $(value).removeClass("nav-tab-active");
10
- });
11
- sections.eq($(this).index()).show();
12
- $(this).addClass('nav-tab-active')
13
- });
14
- }
15
- });
16
-
17
- jQuery(document).on( 'click', '.wpemfb_warning .notice-dismiss', function() {
18
- jQuery.post(ajaxurl, { action: 'close_warning' });
19
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/class-wp-embed-fb-admin.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  class WP_Embed_FB_Admin {
4
  /**
5
  * Add WP Embed Facebook page to Settings
@@ -20,9 +19,40 @@ class WP_Embed_FB_Admin {
20
  if ( $hook_suffix == 'settings_page_embedfacebook' ) {
21
  wp_enqueue_style( 'wpemfb-admin-css', WP_Embed_FB_Plugin::get_url() . 'lib/admin/admin.css' );
22
  }
23
- wp_enqueue_script( 'wpemfb-admin', WP_Embed_FB_Plugin::get_url() . 'lib/admin/admin.js', array( 'jquery-ui-accordion' ) );
24
  }
25
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * Add template editor style to the embeds.
28
  */
1
  <?php
 
2
  class WP_Embed_FB_Admin {
3
  /**
4
  * Add WP Embed Facebook page to Settings
19
  if ( $hook_suffix == 'settings_page_embedfacebook' ) {
20
  wp_enqueue_style( 'wpemfb-admin-css', WP_Embed_FB_Plugin::get_url() . 'lib/admin/admin.css' );
21
  }
 
22
  }
23
+ static function in_admin_footer(){
24
+ global $hook_suffix;
25
+ ob_start();
26
+ if($hook_suffix == 'settings_page_embedfacebook') :
27
+ ?>
28
+ <script type="text/javascript">
29
+ jQuery(document).ready(function() {
30
+ var sections = jQuery('section');
31
+ sections.first().show();
32
+ jQuery(".nav-tab-wrapper a").on('click', function (event) {
33
+ event.preventDefault();
34
+ sections.hide();
35
+ jQuery.each(jQuery(".nav-tab-wrapper a"), function (key, value) {
36
+ jQuery(value).removeClass("nav-tab-active");
37
+ });
38
+ sections.eq(jQuery(this).index()).show();
39
+ jQuery(this).addClass('nav-tab-active')
40
+ });
41
+ });
42
+ </script>
43
+ <?php
44
+ endif;
45
+ if(get_option('wpemfb_close_warning') == 'false') :
46
+ ?>
47
+ <script type="text/javascript">
48
+ jQuery(document).on( 'click', '.wpemfb_warning .notice-dismiss', function() {
49
+ jQuery.post(ajaxurl, { action: 'close_warning' });
50
+ });
51
+ </script>
52
+ <?php
53
+ endif;
54
+ echo ob_get_clean();
55
+ }
56
  /**
57
  * Add template editor style to the embeds.
58
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: Facebook, facebook, Social Plugins, embed facebook, facebook video, facebook posts, facebook publication, facebook publications, facebook event, facebook events, facebook pages, facebook page, facebook profiles, facebook album, facebook albums, facebook photos, facebook photo, social,
5
  Requires at least: 3.8.1
6
  Tested up to: 4.3.2
7
- Stable tag: 2.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -138,6 +138,10 @@ This is a facebook limitation, will try to work around it.
138
 
139
  == Changelog ==
140
 
 
 
 
 
141
  = 2.0.2 =
142
  * Added options for page social plugins
143
  * Changed admin layout
4
  Tags: Facebook, facebook, Social Plugins, embed facebook, facebook video, facebook posts, facebook publication, facebook publications, facebook event, facebook events, facebook pages, facebook page, facebook profiles, facebook album, facebook albums, facebook photos, facebook photo, social,
5
  Requires at least: 3.8.1
6
  Tested up to: 4.3.2
7
+ Stable tag: 2.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
138
 
139
  == Changelog ==
140
 
141
+ = 2.0.3 =
142
+ * Fixed notice on pages and events with no cover
143
+ * Moved admin scripts to footer
144
+
145
  = 2.0.2 =
146
  * Added options for page social plugins
147
  * Changed admin layout
templates/default/event.php CHANGED
@@ -12,7 +12,9 @@ $start_time = date_i18n( $start_time_format, strtotime( $fb_data['start_time'] )
12
  date_default_timezone_set( $old_time_zone );
13
  ?>
14
  <div class="wef-default wef-measure" style="max-width: <?php echo $width ?>px">
 
15
  <div class="cover" style="height:<?php echo $height ?>px; background-image: url('<?php echo $fb_data['cover']['source'] ?>'); background-position: 0% <?php echo $fb_data['cover']['offset_y'] ?>%;" onclick="window.open('http://www.facebook.com/<?php echo $fb_data['id'] ?>', '_blank')" ></div>
 
16
  <div class="row pad-top">
17
  <div class="col-12">
18
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
12
  date_default_timezone_set( $old_time_zone );
13
  ?>
14
  <div class="wef-default wef-measure" style="max-width: <?php echo $width ?>px">
15
+ <?php if(isset($fb_data['cover'])) : ?>
16
  <div class="cover" style="height:<?php echo $height ?>px; background-image: url('<?php echo $fb_data['cover']['source'] ?>'); background-position: 0% <?php echo $fb_data['cover']['offset_y'] ?>%;" onclick="window.open('http://www.facebook.com/<?php echo $fb_data['id'] ?>', '_blank')" ></div>
17
+ <?php endif; ?>
18
  <div class="row pad-top">
19
  <div class="col-12">
20
  <a href="http://www.facebook.com/<?php echo $fb_data['id'] ?>" target="_blank" rel="nofollow">
templates/default/page.php CHANGED
@@ -3,7 +3,9 @@
3
  $show_posts = get_option("wpemfb_show_posts") == "true" ? true : false;
4
  ?>
5
  <div class="wef-default wef-measure" style="max-width: <?php echo $width ?>px" >
6
- <div class="cover" style="height:<?php echo $height ?>px; background-image: url('<?php echo $fb_data['cover']['source'] ?>'); background-position: 0 <?php echo $fb_data['cover']['offset_y'] ?>%; cursor: pointer" onclick="window.open('<?php echo $fb_data['link'] ?>', '_blank')" ></div>
 
 
7
  <div class="row pad-top">
8
  <div class="col-2 text-center">
9
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
3
  $show_posts = get_option("wpemfb_show_posts") == "true" ? true : false;
4
  ?>
5
  <div class="wef-default wef-measure" style="max-width: <?php echo $width ?>px" >
6
+ <?php if(isset($fb_data['cover'])) : ?>
7
+ <div class="cover" style="height:<?php echo $height ?>px; background-image: url('<?php echo $fb_data['cover']['source'] ?>'); background-position: 0 <?php echo $fb_data['cover']['offset_y'] ?>%; cursor: pointer" onclick="window.open('<?php echo $fb_data['link'] ?>', '_blank')" ></div>
8
+ <?php endif; ?>
9
  <div class="row pad-top">
10
  <div class="col-2 text-center">
11
  <a href="<?php echo $fb_data['link'] ?>" target="_blank" rel="nofollow">
wp-embed-facebook.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Embed Facebook
4
  Plugin URI: http://www.wpembedfb.com
5
  Description: Embed any public Facebook video, photo, album, event, page, profile, or post. Copy the facebook url to a single line on your post, or use shortcode [facebook=url ] more information at <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
6
  Author: Miguel Sirvent
7
- Version: 2.0.2
8
  Author URI: http://profiles.wordpress.org/poxtron/
9
  */
10
 
@@ -35,6 +35,7 @@ if(is_admin()){
35
  add_action('admin_menu', array('WP_Embed_FB_Admin','add_page'));
36
  add_action('admin_init', array('WP_Embed_FB_Admin','admin_init'));
37
  add_action('admin_enqueue_scripts', array('WP_Embed_FB_Admin','admin_enqueue_scripts'), 10,1);
 
38
  }
39
 
40
 
4
  Plugin URI: http://www.wpembedfb.com
5
  Description: Embed any public Facebook video, photo, album, event, page, profile, or post. Copy the facebook url to a single line on your post, or use shortcode [facebook=url ] more information at <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
6
  Author: Miguel Sirvent
7
+ Version: 2.0.3
8
  Author URI: http://profiles.wordpress.org/poxtron/
9
  */
10
 
35
  add_action('admin_menu', array('WP_Embed_FB_Admin','add_page'));
36
  add_action('admin_init', array('WP_Embed_FB_Admin','admin_init'));
37
  add_action('admin_enqueue_scripts', array('WP_Embed_FB_Admin','admin_enqueue_scripts'), 10,1);
38
+ add_action('in_admin_footer',array('WP_Embed_FB_Admin','in_admin_footer'));
39
  }
40
 
41