PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 6.2.5
Social Media Auto Poster – Schedule & Publish to Buffer v6.2.5
6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 All 126 releases
← All changes | lib/social/includes/class-image.php +6 -6 6.2.06.2.5 View file →
@@ -47,10 +47,10 @@
47 47 * Helper method to retrieve Image Options
48 48 *
49 49 * @since 3.4.3
50 50 *
51 - * @param bool $network Network (false = defaults).
52 - * @param string $post_type Post Type.
51 + * @param bool $network Network (false = defaults).
52 + * @param bool|string $post_type Post Type.
53 53 * @return array Image Options
54 54 */
55 55 public function get_status_image_options( $network = false, $post_type = false ) {
56 56
@@ -76,9 +76,9 @@
76 76 *
77 77 * @since 3.4.3
78 78 *
79 79 * @param array $options Featured Image Dropdown Options.
80 - * @param string $network Social Network.
80 + * @param bool|string $network Social Network.
81 81 * @param string $post_type Post Type.
82 82 */
83 83 $options = apply_filters( $this->base->plugin->filter_name . '_get_status_image_options', $options, $network, $post_type );
84 84
@@ -102,9 +102,9 @@
102 102 * @param int $image_id Image ID.
103 103 * @param string $source Source Image ID was derived from (plugin, featured_image, post_content, text_to_image).
104 104 * @param bool|string $service Social Media Service the image is for. If not defined, just return the large version.
105 105 * @param bool|string $status_post_type Status format (for example, 'story' or 'post' for Instagram).
106 - * @return array|WP_Error Image ID, Image URLs, Source
106 + * @return array|\WP_Error Image ID, Image URLs, Source
107 107 */
108 108 public function get_image_sources( $image_id, $source, $service = false, $status_post_type = false ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
109 109
110 110 // Load WordPress image libraries, if they are not currently loaded.
@@ -133,11 +133,11 @@
133 133
134 134 // Get image.
135 135 $image_path_and_file = get_attached_file( $image_id );
136 136
137 - // Just return the original image ID if we couldn't get the image path and file.
137 + // Return the large image sources if we couldn't get the image path and file.
138 138 if ( empty( $image_path_and_file ) || ! file_exists( $image_path_and_file ) ) {
139 - return $image_id;
139 + return $this->get_image_source_by_size( $image_id, $source, 'large' );
140 140 }
141 141
142 142 // Load webp image.
143 143 $image = wp_get_image_editor( $image_path_and_file );