Explorar o código

Bumped version to 0.0.63

Jannick Knudsen %!s(int64=4) %!d(string=hai) anos
pai
achega
376552d132
Modificáronse 5 ficheiros con 30 adicións e 4 borrados
  1. 1 1
      VERSION
  2. 1 0
      VERSIONLOG
  3. 1 1
      package.json
  4. 25 0
      plug_shortcodes.php
  5. 2 2
      plugin.php

+ 1 - 1
VERSION

@@ -1 +1 @@
-v0.0.62
+v0.0.63

+ 1 - 0
VERSIONLOG

@@ -61,3 +61,4 @@ v0.0.59
 v0.0.60
 v0.0.61
 v0.0.62
+v0.0.63

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "dagsplug",
-  "version": "0.0.62",
+  "version": "0.0.63",
   "description": "",
   "main": "script_backend.js",
   "scripts": {

+ 25 - 0
plug_shortcodes.php

@@ -413,3 +413,28 @@ if (!function_exists("post_badge")) {
 
 	}
 }
+if (!function_exists("post_images")) {
+
+	function post_images($postid) {
+		global $wpdb;
+		if (isset($postid)) {
+			$images = array();
+			$post_image_attachments = @$wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content FROM $wpdb->posts WHERE post_parent = '$postid' AND post_type = 'attachment' AND post_mime_type LIKE '%image%' ORDER BY menu_order ASC");
+
+			foreach ($post_image_attachments as $attachment) {
+				$url = get_attachment_link($attachment->ID);
+				$id = $attachment->ID;
+				$img_title = apply_filters('the_title', $attachment->post_title);
+				$thumbnail = wp_get_attachment_image_src($attachment->ID, 'thumbnail');
+				$medium = wp_get_attachment_image_src($attachment->ID, 'medium');
+				$large = wp_get_attachment_image_src($attachment->ID, 'large');
+				$xlarge = wp_get_attachment_image_src($attachment->ID, 'xlarge');
+				$full = wp_get_attachment_image_src($attachment->ID, 'full');
+				$image = array('title' => $img_title, 'id' => $id, 'url' => $url, 'thumbnail' => $thumbnail, 'medium' => $medium, 'large' => $large, 'xlarge' => $xlarge, 'full' => $full, 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content);
+
+				array_push($images, $image);
+			}
+			return $images;
+		}
+	}
+}

+ 2 - 2
plugin.php

@@ -4,7 +4,7 @@ Plugin Name: dagsopt
 Plugin URI: https://git.tum.dk/tum.dk/dagsplug/
 Description: Tools
 Author: iskedk
-Version: 0.0.62
+Version: 0.0.63
 Date: 2021-01-14
 Author URI: https://iske.dk/
 Text Domain: dagsopt
@@ -17,7 +17,7 @@ function wppluginspage() {
 $wp_dagsopt = new dagsopt();
 
 class dagsopt {
-	var $version = "0.0.62";
+	var $version = "0.0.63";
 	var $publish_date = "2021-01-14";
 	var $pluginname;
 	var $plugintitle;