Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bug fixes #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions admin-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ function rfi_return_post_types_which_support_featured_images() {
}

function rfi_return_min_dimensions() {
$minimum_size = get_option('rfi_minimum_size');
if (isset($minimum_size['width']) && $minimum_size['width'] == 0) {
$minimum_size['width'] = 0;
}
if (isset($minimum_size['height']) && $minimum_size['height'] == 0) {
$minimum_size['height'] = 0;
}
$minimum_size = get_option( 'rfi_minimum_size', array() );
$minimum_size = wp_parse_args( $minimum_size, array( 'height' => 0, 'width' => 0 ) );

return $minimum_size;
}

Expand All @@ -86,6 +82,6 @@ function rfi_post_types_input_renderer() {

function rfi_size_option_renderer(){
$dimensions = rfi_return_min_dimensions();
echo '<input type="number" name="rfi_minimum_size[width]", value="'.$dimensions["width"].'"> width (px) <br>';
echo '<input type="number" name="rfi_minimum_size[height]", value="'.$dimensions["height"].'"> height (px)<br>';
echo '<input type="number" name="rfi_minimum_size[width]" value="'.$dimensions["width"].'"> width (px) <br>';
echo '<input type="number" name="rfi_minimum_size[height]" value="'.$dimensions["height"].'"> height (px)<br>';
}