Answer the question
In order to leave comments, you need to log in
How to display an image using a wordpress plugin?
<?php
/*
Plugin Name: WPM Image Holder
Plugin URI: https://wp-masters.com
Description: Set Thumbnail to All Posts where Image is not set
Author: WP Masters
Version: 1.0
*/
class ImageHolders {
/**
* Initialise functions
*/
public function __construct()
{
// Put hooks here and look at the example how set function to hooks
add_filter( 'has_post_thumbnail', [$this,'check_post_is_has_thumbnail'], 10, 3 );
}
/**
* Check Posts is has Image before Loop in FrontEnd
*/
public function check_post_is_has_thumbnail($has_thumbnail, $post, $thumbnail_id)
{
if($has_thumbnail == false) {
}
return true;
}
}
new ImageHolders();
if($has_thumbnail == false) {
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question