Changeset 2185958
- Timestamp:
- 11/05/2019 07:05:23 AM (5 years ago)
- Location:
- auto-post-after-image-upload/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
auto-post-after-image-upload/trunk/auto_post_after_image_upload.php
r2182821 r2185958 4 4 Plugin URI: http://wordpress.org/extend/plugins/auto-post-after-image-upload 5 5 Description: This plugin will provide you the facility to create automated post when you will upload an image to your wordpress media gallery. Each time after uploading one media file upload one post will be created with attached this uploaded image automatically 6 Version: 1. 46 Version: 1. 7 7 Author: Shaharia Azam <mail@shaharia.com> 8 8 Author URI: http://www.shaharia.com?utm_source=auto-post-after-image-upload -
auto-post-after-image-upload/trunk/lib/APAIU_Functions.php
r2182821 r2185958 26 26 public static function getAttachmentDetails($attachmentId){ 27 27 $attachment = get_post( $attachmentId ); 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 28 43 $finalData = []; 29 44 $finalData['attachment_id'] = intval($attachment->ID); … … 43 58 $largeImage = wp_get_attachment_image_src( $attachmentId, 'large' ); 44 59 $finalData['media_src_large'] = $largeImage[0]; 45 //$finalData['media_large_width'] = $largeImage[1]; 46 //$finalData['media_large_height'] = $largeImage[2]; 47 48 $imageThumb = wp_get_attachment_image_src( $attachmentId, 'thumbnail' ); 49 $finalData['media_src_thumb'] = $imageThumb[0]; 50 //$finalData['media_thumb_width'] = $imageThumb[1]; 51 //$finalData['media_thumb_height'] = $imageThumb[2]; 52 return $finalData; 60 61 $imagePath = get_attached_file($attachmentId); 62 $imageDimension = wp_get_image_editor($imagePath)->get_size(); 63 $finalData['media_large_width'] = isset($imageDimension['width']) ? $imageDimension['width'] : null; 64 $finalData['media_large_height'] = isset($imageDimension['height']) ? $imageDimension['height'] : null; 65 66 return array_filter($finalData); 53 67 } 54 68 … … 56 70 $preferences = unserialize(get_option("apaiu_prefs", "")); 57 71 $attachment = self::getAttachmentDetails($attachId); 72 73 74 75 58 76 $image_tag = '<p><img src="' . $attachment['media_src_large'] . '" /></p>'; 59 77 … … 124 142 wp_enqueue_style( 'bootstrap.apaiu' ); 125 143 126 wp_register_style( 'sweetalert2.min ', plugins_url( 'assets/css/sweetalert2.min.css', APAIU_FULL_FILE_PATH ), array( "bootstrap.apaiu" ), APAIP_VERSION );127 wp_enqueue_style( 'sweetalert2.min ' );144 wp_register_style( 'sweetalert2.min', plugins_url( 'assets/css/sweetalert2.min.css', APAIU_FULL_FILE_PATH ), array( "bootstrap.apaiu" ), APAIP_VERSION ); 145 wp_enqueue_style( 'sweetalert2.min' ); 128 146 129 147 wp_register_style( 'apaip.main', plugins_url( 'assets/css/main.css', APAIU_FULL_FILE_PATH ), array( "bootstrap.apaiu" ), APAIP_VERSION ); 130 148 wp_enqueue_style( 'apaip.main' ); 131 149 132 wp_register_script( 'popperjs ', plugins_url( 'assets/js/popper.min.js', APAIU_FULL_FILE_PATH ), array( 'jquery' ), APAIP_VERSION, true );133 wp_enqueue_script( "popperjs " );134 135 wp_register_script( 'bootstrap.min ', plugins_url( 'assets/js/bootstrap.min.js', APAIU_FULL_FILE_PATH ), array( 'jquery' ), APAIP_VERSION, true );136 wp_enqueue_script( 'bootstrap.min ' );137 138 wp_register_script( 'sweetalert2.min ', plugins_url( 'assets/js/sweetalert2.min.js', APAIU_FULL_FILE_PATH ), array( 'bootstrap.min' ), APAIP_VERSION, true );139 wp_enqueue_script( 'sweetalert2.min ' );150 wp_register_script( 'popperjs', plugins_url( 'assets/js/popper.min.js', APAIU_FULL_FILE_PATH ), array( 'jquery' ), APAIP_VERSION, true ); 151 wp_enqueue_script( "popperjs" ); 152 153 wp_register_script( 'bootstrap.min', plugins_url( 'assets/js/bootstrap.min.js', APAIU_FULL_FILE_PATH ), array( 'jquery' ), APAIP_VERSION, true ); 154 wp_enqueue_script( 'bootstrap.min' ); 155 156 wp_register_script( 'sweetalert2.min' ), APAIP_VERSION, true ); 157 wp_enqueue_script( 'sweetalert2.min' ); 140 158 141 159 wp_register_script( 'apaip.main', plugins_url( 'assets/js/main.js', APAIU_FULL_FILE_PATH ), array( 142 'bootstrap.min '160 'bootstrap.min' 143 161 ), APAIP_VERSION, true ); 144 162 wp_enqueue_script( 'apaip.main' ); … … 175 193 <section class="jumbotron text-center"> 176 194 <div class="container-full"> 177 <h1 class="jumbotron-heading">Auto 1Post After Image Upload</h1>195 <h1 class="jumbotron-heading">Auto Post After Image Upload</h1> 178 196 <p class="lead text-muted"> 179 197 Create post automatically after you upload any image in your media. It will definitely save lots of … … 285 303 <div class="col-5"> 286 304 <h6>Available Placeholder</h6> 287 <pre> 288 <code style="font-size: 14px; line-height: 3;"> 305 <pre><code style="font-size: 14px; line-height: 2;"> 289 306 {{user_name}} 290 307 {user_display_name}} … … 299 316 300 317 {{media_src_large}} 318 319 301 320 302 321 {{media_src_thumb}} 303 </code> 304 </pre> 322 </code></pre> 305 323 </div> 306 324 </div> -
auto-post-after-image-upload/trunk/readme.txt
r2182821 r2185958 5 5 Requires at least: 4.0 6 6 Tested up to: 5.3 7 Stable tag: 1. 47 Stable tag: 1. 8 8 Requires PHP: 5.5 9 9 License: GPLv2 or later … … 47 47 == Changelog == 48 48 49 50 51 52 53 49 54 = 1.4 = 50 55 * Few minor bug fixed. Few buggy placeholder disabled that will be fixed in later updates
Note: See TracChangeset
for help on using the changeset viewer.