Default license selector #51

Merged
lemsmyth merged 3 commits from default-license-select into master 2022-02-13 17:39:42 +01:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 3368ffdfd7 - Show all commits

View file

@ -25,6 +25,7 @@ class LBRY_Admin
*/
public function create_options_page()
{
add_menu_page(
__( 'LBRYPress Settings', 'lbrypress' ),
__( 'LBRYPress', 'lbrypress' ),
@ -68,7 +69,7 @@ class LBRY_Admin
{
// Register the LBRY Setting array
register_setting(
LBRY_SETTINGS_GROUP,
'lbry_general_settings',
LBRY_SETTINGS,
array( $this, 'sanitize_general_settings' )
);
@ -115,7 +116,6 @@ class LBRY_Admin
/**
* Speech Admin Page settings
*/
@ -275,7 +275,7 @@ class LBRY_Admin
}
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_SETTINGS,
$options

View file

@ -82,6 +82,8 @@ class LBRY_Network
$will_publish = (isset($_POST[LBRY_WILL_PUBLISH]) ? $_POST[LBRY_WILL_PUBLISH] : false);
$new_channel = (isset($_POST[LBRY_POST_CHANNEL]) ? $_POST[LBRY_POST_CHANNEL] : null);
$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
if (!$will_publish) {