options = get_option(LBRY_SETTINGS); require_once( LBRY_ABSPATH . 'templates/options-page.php' ); } /** * Sanitizes setting input * // COMBAK Potentially sanitize more */ public function sanitize_general_settings( $input ) { if (!empty($input[LBRY_SPEECH_CHANNEL])) { $channel = $input[LBRY_SPEECH_CHANNEL]; $channel = str_replace('@', '', $channel); $input[LBRY_SPEECH_CHANNEL] = $channel; } if (!empty($input[LBRY_SPEECH_PW])) { $encrypted = $this->encrypt($input['lbry_speech_pw']); $input[LBRY_SPEECH_PW] = $encrypted; } else { // If we have a password and its empty, keep orginal password if (!empty(get_option(LBRY_SETTINGS)[LBRY_SPEECH_PW])) { $input[LBRY_SPEECH_PW] = get_option(LBRY_SETTINGS)[LBRY_SPEECH_PW]; } } return $input; } /** * Section info for the General Section */ public function general_section_callback() { print 'This is where you can configure how LBRYPress will distribute your content:'; } /** * Prints Wallet input */ public function wallet_callback() { // Get first available account address from Daemon $address = LBRY()->daemon->address_list(); $address = is_array($address) && !empty($address) ? $address[0]->address : ''; printf( '', LBRY_WALLET, LBRY_SETTINGS, $address ); } /** * Prints Spee.ch input */ public function speech_callback() { printf( '', LBRY_SPEECH, LBRY_SETTINGS, isset($this->options[LBRY_SPEECH]) ? esc_attr($this->options[LBRY_SPEECH]) : '' ); } /** * Prints Spee.ch channel input */ public function speech_channel_callback() { printf( '@', LBRY_SPEECH_CHANNEL, LBRY_SETTINGS, isset($this->options[LBRY_SPEECH_CHANNEL]) ? esc_attr($this->options[LBRY_SPEECH_CHANNEL]) : '' ); } /** * Prints Spee.ch password input */ public function speech_pw_callback() { printf( 'licenses as $value => $name) { $selected = $this->options[LBRY_LICENSE] === $value; $options .= '