mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
Add filter to create a conditional to check if the plugin can run
This commit is contained in:
@@ -34,6 +34,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter( 'displayfeaturedimagegenesis_can_do', array( $this, 'can_do_things' ) );
|
||||
$this->common = new Display_Featured_Image_Genesis_Common();
|
||||
$this->item = Display_Featured_Image_Genesis_Common::get_image_variables();
|
||||
add_filter( 'jetpack_photon_override_image_downsize', '__return_true' );
|
||||
@@ -108,7 +109,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
|
||||
/**
|
||||
* Pass variables through to our js
|
||||
* @return backstretchVars variable array to send to js
|
||||
* @return $output variable array to send to js
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
@@ -291,7 +292,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
*
|
||||
* @since 2.3.4
|
||||
*/
|
||||
protected function can_do_things() {
|
||||
public function can_do_things() {
|
||||
$medium = (int) apply_filters( 'displayfeaturedimagegenesis_set_medium_width', get_option( 'medium_size_w' ) );
|
||||
$width = (int) $this->item->backstretch[1];
|
||||
|
||||
|
||||
@@ -215,3 +215,13 @@ function displayfeaturedimagegenesis_check_image_id( $image_id = '' ) {
|
||||
$image_id = is_numeric( $image_id ) ? $image_id : Display_Featured_Image_Genesis_Common::get_image_id( $image_id );
|
||||
return $image_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* helper function to evaluate whether or not the plugin can run.
|
||||
* @return mixed|void
|
||||
*
|
||||
* @since 2.4.2
|
||||
*/
|
||||
function displayfeaturedimagegenesis_can_do() {
|
||||
return apply_filters( 'displayfeaturedimagegenesis_can_do', false );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user