Defaults set (#56)

* set defaults
This commit is contained in:
Lemuel Smyth 2022-02-13 11:11:14 -06:00 committed by GitHub
parent d6c9c4a55e
commit 2c9379394f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View file

@ -185,9 +185,11 @@ class LBRYPress
//Default options //Default options
$option_defaults = array( $option_defaults = array(
LBRY_WALLET => '',
LBRY_LICENSE => $this->licenses[0], 'lbry_default_publish_setting' => '',
LBRY_LBC_PUBLISH => 1 'default_lbry_channel' => '',
LBRY_LICENSE => '',
LBRY_LBC_PUBLISH => 0.001,
); );
add_option( LBRY_SETTINGS, $option_defaults, false ); add_option( LBRY_SETTINGS, $option_defaults, false );

View file

@ -311,6 +311,24 @@ class LBRY_Admin
); );
} }
/**
* Checkbox to default to always allow publish on LBRY
*/
public function lbry_always_pub_callback()
{
$options = get_option( LBRY_SETTINGS )['lbry_default_publish_setting'];
if ( ! isset( $options ) ) {
$options = 0;
}
$checked = checked( $options, 1, false );
printf(
'<input type="checkbox" id="lbry_default_publish_setting" name="' . esc_attr('%2$s[%1$s]') . '" value="1" ' . esc_attr( $checked ) . '><p>Set Default to always Publish to <strong>LBRY</strong>, this can be adjusted when publishing a New Post.</p>',
'lbry_default_publish_setting',
LBRY_SETTINGS,
);
}
/** /**
* Prints select to choose a default to publish to channel * Prints select to choose a default to publish to channel
*/ */