diff --git a/WordPressPCL/Client/Media.cs b/WordPressPCL/Client/Media.cs index 8242008..e8d711a 100644 --- a/WordPressPCL/Client/Media.cs +++ b/WordPressPCL/Client/Media.cs @@ -116,6 +116,18 @@ public async Task> GetAll(bool embed = false, bool useAut return entities; } + /// + /// Get All by Post ID + /// + /// ID + /// Include embed info + /// Send request with authenication header + /// List of all result + public async Task> GetAllByPostID(int ID, bool embed = false, bool useAuth = false) + { + return (await _httpHelper.GetRequest>($"{_defaultPath}{_methodPath}?parent={ID}", embed, useAuth).ConfigureAwait(false))?.ToList(); + } + /// /// Get Entity by Id /// diff --git a/WordPressPCL/Models/Post.cs b/WordPressPCL/Models/Post.cs index 7e21e11..2835441 100644 --- a/WordPressPCL/Models/Post.cs +++ b/WordPressPCL/Models/Post.cs @@ -219,6 +219,12 @@ public class Post : Base [JsonProperty("_embedded", DefaultValueHandling = DefaultValueHandling.Ignore)] public Embedded Embedded { get; set; } + /// + /// Custom Fields. You have to add action to functions.php + /// + [JsonProperty("custom_fields", DefaultValueHandling = DefaultValueHandling.Ignore)] + public IDictionary CustomFields { get; set; } + /// /// Parameterless constructor /// diff --git a/WordPressPCL/WordPressPCL.xml b/WordPressPCL/WordPressPCL.xml index 3105cf8..032f652 100644 --- a/WordPressPCL/WordPressPCL.xml +++ b/WordPressPCL/WordPressPCL.xml @@ -243,6 +243,15 @@ Send request with authenication header List of all result + + + Get All by Post ID + + ID + Include embed info + Send request with authenication header + List of all result + Get Entity by Id @@ -1029,7 +1038,7 @@ Status of Comments - + Comment Approved @@ -2131,6 +2140,11 @@ Embedded information like featured images + + + Custom Fields. You have to add action to functions.php + + Parameterless constructor