default license select option

This commit is contained in:
Lem Smyth 2022-02-12 15:46:20 -06:00
parent bf183aac5a
commit 3368ffdfd7
2 changed files with 5 additions and 3 deletions

View file

@ -25,6 +25,7 @@ class LBRY_Admin
*/ */
public function create_options_page() public function create_options_page()
{ {
add_menu_page( add_menu_page(
__( 'LBRYPress Settings', 'lbrypress' ), __( 'LBRYPress Settings', 'lbrypress' ),
__( 'LBRYPress', 'lbrypress' ), __( 'LBRYPress', 'lbrypress' ),
@ -68,7 +69,7 @@ class LBRY_Admin
{ {
// Register the LBRY Setting array // Register the LBRY Setting array
register_setting( register_setting(
LBRY_SETTINGS_GROUP, 'lbry_general_settings',
LBRY_SETTINGS, LBRY_SETTINGS,
array( $this, 'sanitize_general_settings' ) array( $this, 'sanitize_general_settings' )
); );
@ -115,7 +116,6 @@ class LBRY_Admin
/** /**
* Speech Admin Page settings * Speech Admin Page settings
*/ */
@ -275,7 +275,7 @@ class LBRY_Admin
} }
printf( printf(
'<select id="%1$s" name="%2$s[%1$s]">%3$s</select>', '<select id="'.esc_attr('%1$s').'" name="'. esc_attr('%2$s[%1$s]') .'">' . esc_html('%3$s') . '</select>',
LBRY_LICENSE, LBRY_LICENSE,
LBRY_SETTINGS, LBRY_SETTINGS,
$options $options

View file

@ -82,6 +82,8 @@ class LBRY_Network
$will_publish = (isset($_POST[LBRY_WILL_PUBLISH]) ? $_POST[LBRY_WILL_PUBLISH] : false); $will_publish = (isset($_POST[LBRY_WILL_PUBLISH]) ? $_POST[LBRY_WILL_PUBLISH] : false);
$new_channel = (isset($_POST[LBRY_POST_CHANNEL]) ? $_POST[LBRY_POST_CHANNEL] : null); $new_channel = (isset($_POST[LBRY_POST_CHANNEL]) ? $_POST[LBRY_POST_CHANNEL] : null);
$cur_channel = get_post_meta($post_id, LBRY_POST_CHANNEL, true); $cur_channel = get_post_meta($post_id, LBRY_POST_CHANNEL, true);
$license = $_POST[LBRY_POST_PUB_LICENSE];
$cur_license = get_post_meta( $post_id, LBRY_POST_PUB_LICENSE, true );
// Update meta acordingly // Update meta acordingly
if (!$will_publish) { if (!$will_publish) {