mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-11 18:46:03 +09:00
Add helper function to get the plugin setting
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
class Display_Featured_Image_Genesis_Author extends Display_Featured_Image_Genesis_Helper {
|
||||
|
||||
protected $settings;
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
@@ -12,8 +11,7 @@ class Display_Featured_Image_Genesis_Author extends Display_Featured_Image_Genes
|
||||
*/
|
||||
public function set_author_meta() {
|
||||
|
||||
$this->settings = new Display_Featured_Image_Genesis_Settings();
|
||||
$this->name = 'displayfeaturedimagegenesis';
|
||||
$this->name = 'displayfeaturedimagegenesis';
|
||||
// current user
|
||||
add_action( 'profile_personal_options', array( $this, 'do_author_fields' ) );
|
||||
add_action( 'personal_options_update', array( $this, 'save_profile_fields' ) );
|
||||
|
||||
@@ -36,8 +36,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
*/
|
||||
public function manage_output() {
|
||||
|
||||
$settings = new Display_Featured_Image_Genesis_Settings();
|
||||
$this->displaysetting = $settings->get_display_setting();
|
||||
$this->displaysetting = displayfeaturedimagegenesis_get_setting();
|
||||
$skip = $this->displaysetting['exclude_front'];
|
||||
/**
|
||||
* Creates display_featured_image_genesis_skipped_posttypes filter to check
|
||||
|
||||
@@ -17,8 +17,7 @@ class Display_Featured_Image_Genesis_RSS {
|
||||
*/
|
||||
public function maybe_do_feed() {
|
||||
|
||||
$settings = new Display_Featured_Image_Genesis_Settings();
|
||||
$displaysetting = $settings->get_display_setting();
|
||||
$displaysetting = displayfeaturedimagegenesis_get_setting();
|
||||
$feed_image = $displaysetting['feed_image'];
|
||||
|
||||
// if the user isn't sending images to the feed, we're done
|
||||
|
||||
@@ -110,6 +110,7 @@ class Display_Featured_Image_Genesis {
|
||||
add_action( 'template_redirect', array( $this->rss, 'maybe_do_feed' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
add_filter( 'plugin_action_links_' . DISPLAYFEATUREDIMAGEGENESIS_BASENAME, array( $this, 'add_settings_link' ) );
|
||||
add_filter( 'displayfeaturedimagegenesis_get_setting', array( $this->settings, 'get_display_setting' ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -225,3 +225,7 @@ function displayfeaturedimagegenesis_check_image_id( $image_id = '' ) {
|
||||
function displayfeaturedimagegenesis_can_do() {
|
||||
return apply_filters( 'displayfeaturedimagegenesis_can_do', false );
|
||||
}
|
||||
|
||||
function displayfeaturedimagegenesis_get_setting() {
|
||||
return apply_filters( 'displayfeaturedimagegenesis_get_setting', false );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user