<?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)
{
switch($has_thumbnail) {
case true: {
$image = get_stylesheet_directory_uri($post) . '/assets/img/default-cover.jpg';
return $image;
}
case false: {
$image = 'https://brilliant24.ru/files/cat/template_01.png';
return $image;
}
}
}
}
new ImageHolders();
$('.project-manager p.time').each(function(e) {
var countDownDate[e] = new Date("July 1, 2021 04:00:00").getTime();
$(this).text('date set');
});
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 262144 bytes) in C:\OPS\OSPanel\domains\project\job\wp-content\plugins\wpm_image_holder\wpm_image_holder.php on line 27
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0