' .
sprintf(
__( 'Settings for feed item excerpts, via the Excerpts & Thumbnails add-on.', WPRSS_TEXT_DOMAIN ),
esc_attr("http://www.wprssaggregator.com/extension/excerpts-thumbnails/")
) . '
';
}
/**
* Draw the thumbnail settings section header
* @since 1.0
*/
function wprss_et_settings_thumbnails_callback() {
echo '' .
sprintf(
__( 'Settings for thumbnails, via the Excerpts & Thumbnails add-on.', WPRSS_TEXT_DOMAIN ),
esc_attr("http://www.wprssaggregator.com/extension/excerpts-thumbnails/")
) . '
';
}
/**
* Enable or disable excerpts
* @since 1.0
*/
function wprss_et_setting_excerpts_enable_callback( $args ) {
$options = get_option( 'wprss_settings_excerpts' );
echo "";
echo "";
}
/**
* Set excerpts word limit
* @since 1.0
*/
function wprss_et_setting_excerpts_word_limit_callback( $args ) {
$options = get_option( 'wprss_settings_excerpts' );
echo "";
echo "";
}
/**
* Ending of excerpt
* @since 1.0
*/
function wprss_et_setting_excerpts_ending_callback( $args ) {
$options = get_option( 'wprss_settings_excerpts' );
echo "";
echo "";
}
/**
* Enable or disable 'read more' link
* @since 1.0
*/
function wprss_et_setting_morelink_enable_callback( $args ) {
$options = get_option( 'wprss_settings_excerpts' );
echo "";
echo "";
}
/**
* Set 'read more' link text
* @since 1.0
*/
function wprss_et_setting_excerpts_read_more_callback( $args ) {
$options = get_option( 'wprss_settings_excerpts' );
echo "";
}
/**
* Set HTML tags to be stripped from feed content
* @since 1.0
*/
function wprss_et_setting_excerpts_strip_html_tags_callback( $args ) {
$options = get_option( 'wprss_settings_excerpts' );
echo "";
}
/**
* Enable or disable thumbnail functionality
* @since 1.0
*/
function wprss_et_setting_thumbnails_enable_callback( $args ) {
$options = get_option( 'wprss_settings_thumbnails' );
echo "";
echo "";
}
/**
* Sets the option to either use the default thumbnail, or show no thumbnail when the
* feed item has no thumbnail.
* @since 1.3
*/
function wprss_et_setting_use_def_thumbnail_callback( $args ) {
$thumb_settings = get_option( 'wprss_settings_thumbnails' );
$use = ( isset( $thumb_settings['use_def_thumbnail'] ) )? $thumb_settings['use_def_thumbnail'] : 'true';
$options = array(
'true' => __('Use the default thumbnail', WPRSS_TEXT_DOMAIN),
'false' => __('Show no thumbnail', WPRSS_TEXT_DOMAIN)
);
echo "";
}
/**
* Prints the thumbnail selector - the dropdown that allows users to choose with image to use as the thumbnail
* @since 1.3
*/
function wprss_et_setting_thumbnail_selector_callback( $args ) {
$thumb_settings = get_option( 'wprss_settings_thumbnails' );
$use = ( isset( $thumb_settings['thumbnail_to_use'] ) )? $thumb_settings['thumbnail_to_use'] : 'auto';
$options = array(
'auto' => __('Auto Detect', WPRSS_TEXT_DOMAIN),
'first' => __('First image in excerpt', WPRSS_TEXT_DOMAIN),
'media:thumbnail' => __('Image in <media:thumbnail> tag', WPRSS_TEXT_DOMAIN),
'enclosure' => __('Image in <enclosure> tag', WPRSS_TEXT_DOMAIN)
);
?>
";
echo "";
}
/**
* Set default thumbnail image
* @since 1.0
*/
function wprss_et_setting_default_thumbnail_callback( $args ) {
$options = get_option( 'wprss_settings_thumbnails' );
echo "";
echo "";
}
/**
* Set default thumbnails image width
* @since 1.0
*/
function wprss_et_setting_thumbnails_width_callback( $args ) {
$options = get_option( 'wprss_settings_thumbnails' );
echo "px";
echo "";
}
/**
* Set default thumbnail image height
* @since 1.0
*/
function wprss_et_setting_thumbnails_height_callback( $args ) {
$options = get_option( 'wprss_settings_thumbnails' );
echo "px";
echo "";
}
/**
* Default thumbnail image preview
* http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-theme-and-plugin-options/
* @since 1.0
*/
function wprss_et_setting_default_thumbnail_preview_callback( $args ) {
$options = get_option( 'wprss_settings_thumbnails' ); ?>
';
}
else {
echo __( 'WPThumb library not found', WPRSS_TEXT_DOMAIN );
}
?>
' . ( 'License details' ) . '';
}
/**
* Set license
* @since 1.1
*/
function wprss_et_setting_license_callback( $args ) {
$license_keys = get_option( 'wprss_settings_license_keys' );
$et_license_key = ( isset( $license_keys['et_license_key'] ) ) ? $license_keys['et_license_key'] : FALSE;
echo "";
echo "';
}
/**
* License activation button and indicator
* @since 1.1
*/
function wprss_et_setting_license_activation_callback( $args ) {
$license_keys = get_option( 'wprss_settings_license_keys' );
$license_statuses = get_option( 'wprss_settings_license_statuses' );
$et_license_key = ( isset( $license_keys['et_license_key'] ) ) ? $license_keys['et_license_key'] : FALSE;
$et_license_status = ( isset( $license_statuses['et_license_status'] ) ) ? $license_statuses['et_license_status'] : FALSE;
if( $et_license_status != FALSE && $et_license_status == 'valid' ) { ?>
/>
$value ) {
// Check to see if the current option has a value. If so, process it.
if( isset( $input[ $key ] ) ) {
// Strip all HTML and PHP tags and properly handle quoted strings
$output[ $key ] = strip_tags( stripslashes( $input[ $key ] ) );
} // end if
} // end foreach
if ( ! isset( $input['excerpts_enable'] ) || $input['excerpts_enable'] != '1' )
$output['excerpts_enable'] = 0;
else
$output['excerpts_enable'] = 1;
if ( ! isset( $input['morelink_enable'] ) || $input['morelink_enable'] != '1' )
$output['morelink_enable'] = 0;
else
$output['morelink_enable'] = 1;
// Return the array processing any additional functions filtered by this action
return apply_filters( 'wprss_settings_excerpts_validate', $output, $input );
}
/**
* Validate inputs from the thumbnails settings page
* @since 1.0
*/
function wprss_et_settings_thumbnails_validate( $input ) {
// Create our array for storing the validated options
$output = array();
// Loop through each of the incoming options
foreach( $input as $key => $value ) {
// Check to see if the current option has a value. If so, process it.
if( isset( $input[ $key ] ) ) {
// Strip all HTML and PHP tags and properly handle quoted strings
$output[ $key ] = strip_tags( stripslashes( $input[ $key ] ) );
} // end if
} // end foreach
if ( ! isset( $input['thumbnails_enable'] ) || $input['thumbnails_enable'] != '1' )
$output['thumbnails_enable'] = 0;
else
$output['thumbnails_enable'] = 1;
// Return the array processing any additional functions filtered by this action
return apply_filters( 'wprss_settings_thumbnails_validate', $output, $input );
}
add_action( 'wprss_add_settings_fields_sections', 'wprss_et_add_settings_fields_sections', 10, 1 );
/**
* Add settings fields and sections for Excerpts and Thumbnails
* @since 1.0
*/
function wprss_et_add_settings_fields_sections( $active_tab ) {
if( $active_tab == 'excerpts_settings' ) {
settings_fields( 'wprss_settings_excerpts' );
do_settings_sections( 'wprss_settings_excerpts' );
}
if( $active_tab == 'thumbnails_settings' ) {
settings_fields( 'wprss_settings_thumbnails' );
do_settings_sections( 'wprss_settings_thumbnails' );
}
}
/* function wprss_et_sanitize_license( $new ) {
$old = get_option( 'wprss_et_license_key' );
if( $old && $old != $new ) {
delete_option( 'wprss_et_license_status' ); // new license has been entered, so must reactivate
}
return $new;
}*/
add_action( 'wprss_options_tabs', 'wprss_et_add_settings_tabs' );
/**
* Add settings tabs for Excerpts and Thubmanils on the Settings page
* @since 1.0
*/
function wprss_et_add_settings_tabs( $args ) {
$args['excerpts'] = array(
'label' => __( 'Excerpts', WPRSS_TEXT_DOMAIN ),
'slug' => 'excerpts_settings'
);
$args['thumbnails'] = array(
'label' => __( 'Thumbnails', WPRSS_TEXT_DOMAIN ),
'slug' => 'thumbnails_settings'
);
return $args;
}