Changeset 1910099
- Timestamp:
- 07/17/2018 01:39:54 AM (8 years ago)
- Location:
- complete-open-graph
- Files:
-
- 34 added
- 4 edited
-
tags/3.3.1 (added)
-
tags/3.3.1/complete-open-graph.php (added)
-
tags/3.3.1/composer.json (added)
-
tags/3.3.1/index.php (added)
-
tags/3.3.1/readme.txt (added)
-
tags/3.3.1/src (added)
-
tags/3.3.1/src/Filters.php (added)
-
tags/3.3.1/src/Generator.php (added)
-
tags/3.3.1/src/Metabox.php (added)
-
tags/3.3.1/src/PostDecorator.php (added)
-
tags/3.3.1/src/Settings.php (added)
-
tags/3.3.1/src/Support.php (added)
-
tags/3.3.1/src/Utilities.php (added)
-
tags/3.3.1/src/assets (added)
-
tags/3.3.1/src/assets/css (added)
-
tags/3.3.1/src/assets/css/style.css (added)
-
tags/3.3.1/src/assets/img (added)
-
tags/3.3.1/src/assets/img/github.svg.php (added)
-
tags/3.3.1/src/assets/img/twitter.svg.php (added)
-
tags/3.3.1/src/assets/img/wordpress.svg.php (added)
-
tags/3.3.1/src/assets/js (added)
-
tags/3.3.1/src/assets/js/scripts.js (added)
-
tags/3.3.1/src/assets/scss (added)
-
tags/3.3.1/src/assets/scss/_variables.scss (added)
-
tags/3.3.1/src/assets/scss/components (added)
-
tags/3.3.1/src/assets/scss/components/_SK_Box.scss (added)
-
tags/3.3.1/src/assets/scss/components/_SK_FeedbackList.scss (added)
-
tags/3.3.1/src/assets/scss/components/_SK_ImageHolder.scss (added)
-
tags/3.3.1/src/assets/scss/components/_SK_SidebarBlock.scss (added)
-
tags/3.3.1/src/assets/scss/layouts (added)
-
tags/3.3.1/src/assets/scss/layouts/_metabox.scss (added)
-
tags/3.3.1/src/assets/scss/layouts/_settings.scss (added)
-
tags/3.3.1/src/assets/scss/style.scss (added)
-
tags/3.3.1/src/index.php (added)
-
trunk/complete-open-graph.php (modified) (1 diff)
-
trunk/composer.json (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Filters.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
complete-open-graph/trunk/complete-open-graph.php
r1901559 r1910099 3 3 * Plugin Name: Complete Open Graph 4 4 * Description: Simple, comprehensive, highly customizable Open Graph management. 5 * Version: 3.3. 05 * Version: 3.3.1 6 6 * Author: Alex MacArthur 7 7 * Author URI: https://macarthur.me -
complete-open-graph/trunk/composer.json
r1901559 r1910099 5 5 "minimum-stability": "stable", 6 6 "license": "GPL-2.0", 7 "version": "3.3. 0",7 "version": "3.3.1", 8 8 "authors": [ 9 9 { … … 16 16 "support" : { 17 17 "issues": "https://wordpress.org/support/plugin/complete-open-graph", 18 "source": "https://downloads.wordpress.org/plugin/complete-open-graph.3.3. 0.zip"18 "source": "https://downloads.wordpress.org/plugin/complete-open-graph.3.3.1.zip" 19 19 }, 20 20 "autoload-dev": { -
complete-open-graph/trunk/readme.txt
r1901559 r1910099 5 5 Tags: open graph, seo, open graph protocol, twitter, facebook, social media, google plus 6 6 Requires at least: 3.9 7 Tested up to: 4.9. 68 Stable tag: 3.3. 07 Tested up to: 4.9.7 8 Stable tag: 3.3.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 287 287 * Add filter to disable Open Graph tags per page. 288 288 289 = 3.3.1 = 290 * Improve the logic (and respective efficiency) of determining how image meta tags are generated. 291 289 292 == Feedback == 290 293 -
complete-open-graph/trunk/src/Filters.php
r1901559 r1910099 26 26 public function attach_image_dimensions($value, $field_name) { 27 27 28 $width = ''; 29 $height = ''; 30 28 //-- This is probably a URL from an older version of the plugin. Just return it. 31 29 if(!is_numeric($value)) return $value; 32 30 33 //-- Ensure this is actually an integer. 34 $value = intval($value); 31 $imageSizes = array( 32 'complete_open_graph', 33 'large', 34 'medium_large', 35 'medium', 36 'full' 37 ); 35 38 36 //-- If this attachment doesn't actually exist or isn't an image, just get out of here. 37 if(!wp_attachment_is_image($value)) return ''; 39 $data = false; 40 $attachmentMeta = wp_get_attachment_metadata($value); 41 $sizes = isset($attachmentMeta['sizes']) ? $attachmentMeta['sizes'] : array(); 38 42 39 $attachment_meta = wp_get_attachment_metadata($value); 43 //-- The 'full' size isn't included by default. 44 $sizes['full'] = true; 40 45 41 //-- For some weird reason, some images might not have a size key? It's apparently happened...42 if(empty($attachment_meta) || !isset($attachment_meta['sizes'])) return '';46 //-- Loop over each image size. Serves as a fallback mechanism if it doesn't exist at the ideal size. 47 foreach($imageSizes as $size) { 43 48 44 if(array_key_exists('complete_open_graph', $attachment_meta['sizes'])) { 45 $meta = wp_get_attachment_image_src($value, 'complete_open_graph'); 46 } elseif(array_key_exists('large', $attachment_meta['sizes'])) { 47 $meta = wp_get_attachment_image_src($value, 'large'); 48 } else { 49 $meta = false; 49 //-- We have an image! 50 if(array_key_exists($size, $sizes)) { 51 $data = wp_get_attachment_image_src($value, $size); 52 break; 53 } 50 54 } 51 55 52 //-- If, for some reason, no image is returned, just get out of here.53 if( !($meta)) return '';56 //-- If, for some reason, no image is returned, exit. Should NEVER actually happen, but you know... #wordpress. 57 if(empty($data)) return ''; 54 58 55 $value = $ meta[0];56 $width = $ meta[1];57 $height = $ meta[2];59 $value = $data[0]; 60 $width = $data[1]; 61 $height = $data[2]; 58 62 59 63 //-- Set image sizes.
Note: See TracChangeset
for help on using the changeset viewer.