-
Notifications
You must be signed in to change notification settings - Fork 472
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
Add support for togglable "Advanced Settings" in download file metabox row #9583
Conversation
$variable_pricing = edd_has_variable_prices( $post_id ); | ||
$variable_display = $variable_pricing ? '' : ' style="display:none;"'; | ||
$variable_class = $variable_pricing ? ' has-variable-pricing' : ''; | ||
$custom_file_options = isset( $wp_filter['edd_download_file_option_row'] ) ? true : false; ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$custom_file_options = isset( $wp_filter['edd_download_file_option_row'] ) ? true : false; ?> | |
$custom_file_options = has_action( 'edd_download_file_option_row' ); | |
?> |
And the global can be removed from line 803. Also please fix the alignment/spaces in the previous variables (some tabs have gotten mixed in).
<?php | ||
$actions = array(); | ||
if ( $custom_file_options ) { | ||
$actions['show_advanced'] = '<a href="#" class="toggle-custom-price-option-section">' . __( 'Show advanced settings', 'easy-digital-downloads' ) . '</a>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$actions['show_advanced'] = '<a href="#" class="toggle-custom-price-option-section">' . __( 'Show advanced settings', 'easy-digital-downloads' ) . '</a>'; | |
$actions['show_advanced'] = '<a class="toggle-custom-price-option-section">' . __( 'Show advanced settings', 'easy-digital-downloads' ) . '</a>'; |
This really should be a button instead of a link but I know this is following the pattern set by the existing "button"...but the href
should be removed, pending fixing all of the buttons in the metaboxes.
if ( $custom_file_options ) { | ||
?> | ||
|
||
<div class="edd-custom-price-option-sections-wrap"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is using the class that it is to inherit the JS behavior without needing to modify the JS, but I would suggest adding an additional file specific class here so that it's a little less confusing when reading the code/markup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robincornett I actually badly hurt my hand at the weekend, so typing (and coding) is a pain. Would you be able to make the required changes here please? Would help me a lot, as I am taking a break from coding until my hand recovers (also upgrading my mouse and keyboard to help).
Fixes #9261
Added supported for "advanced settings" in the file metabox row. This was needed as I need to allow the ability to add settings on a per file basis and the row option wasn't a good option from a UX perspective.
See an example of it working here:
Please do not submit PRs with minified CSS or JS files. This is managed at the time of release by the Core Team