eyeofthenyte
Forum Replies Created
-
Forum: Plugins
In reply to: [Default Featured Image] Database ValueYou were right. I was just messing up with the syntax and arguments within the wp_get_attachment_url. Thanks again! Appreciate your help and enjoy the plugin as well.
Forum: Plugins
In reply to: [Default Featured Image] Database ValueI am trying to make a URL for either the DFI or the normal featured image. I know that I need to reference the the ID but am uncertain how to generate the rest of the URL. Place it into the
$thumb_url
variable below so it goes to my websocket appropriately.
The best I achieved was getting a “default.jpg” at one point but it was essentially just a default missing image icon.if ( $new_status != 'publish' || $old_status == 'publish' || $post->post_type != 'post') return; $webhookURL = get_option('discord_webhook_url'); $id = $post->ID; //$author = $post->post_author; //$authorName = get_the_author_meta('display_name', $author); $postTitle = $post->post_title; $permalink = get_permalink($id); $thumb_url = "default-or-featured-image-url"; $description = $post->post_excerpt; $timestamp = $post->post_date; $postData = json_encode([ "content" => "@here A dragonet just dropped off a new parchment: ", //"avatar_url" => "image url here", // Embeds Array "embeds" => [ [ "title" => $postTitle, "type" => "rich", "description" => $description, "url" => $permalink, "timestamp" => $timestamp, "color" => hexdec( "3366ff" ), "footer" => [ "text" => "EoN Creations - https://eoncreations.com", "icon_url" => "https://eoncreations.com/wp-content/uploads/2020/02/cropped-EggOracle-180x180.png" ], "image" => [ "url" => $thumb_url ], "thumbnail" => [ "url" => $permalink ] ] ] ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
- This reply was modified 4 years ago by eyeofthenyte.
- This reply was modified 4 years ago by eyeofthenyte.
Forum: Plugins
In reply to: [Default Featured Image] Database ValueAhh I see. I guess I’m more looking to generate a link for said image. I’ll give the snippet a try. I’m pretty new to all of this but I think that’s in the media.php file. Taking a stab in the dark haha. Thanks for your assistance so far.
Well, It definitely looks like I merged some things and didn’t quite go far enough in other places. I ended up finding some more info and things are working now.