So I am trying to add some options that are specific to what I need.
So in the Peafowl theme I opened up
In there I added a copy of the "Download Button" code an renamed every part that was specific:
theme_peafowl_download_src_button:
It shows up nicely in the settings pages, but the option is not saved (it always stays on disabled)
Is there something I am missing?
EDIT1:
Ah I needed to add the option in the Database table too.
Now for my second and new question:
On each image there is a button to "edit image details"
This modal has some options.
What I want to do is add 2 new options to this modal
1: a checkbox for "is source available?"
2: a dropdown with a list of extension to specify what the source extension is.
I want to be able to edit these options per image so that the button that downloads the source file gets all the correct info.
So in the Peafowl theme I opened up
Code:
dashboard.php
In there I added a copy of the "Download Button" code an renamed every part that was specific:
theme_peafowl_download_src_button:
HTML:
<div class="input-label">
<label for="theme_peafowl_download_src_button"><?php _se('Enable source download button'); ?</label>
<div class="c5 phablet-c1"><select type="text" name="theme_peafowl_download_src_button" id="theme_peafowl_download_src_button" class="text-input">
<?php
echo CHV\Render\get_select_options_html([1 => _s('Enabled'), 0 => _s('Disabled')], CHV\get_chv_setting('theme_peafowl_download_src_button'));
?>
</select></div>
<div class="input-below"><?php _se('Enable this if you want to show the source download button.'); ?> </div>
</div>
It shows up nicely in the settings pages, but the option is not saved (it always stays on disabled)
Is there something I am missing?
EDIT1:
Ah I needed to add the option in the Database table too.
Now for my second and new question:
On each image there is a button to "edit image details"
This modal has some options.
What I want to do is add 2 new options to this modal
1: a checkbox for "is source available?"
2: a dropdown with a list of extension to specify what the source extension is.
I want to be able to edit these options per image so that the button that downloads the source file gets all the correct info.
Last edited: