whitespace and general cleanup #63

Merged
lemsmyth merged 29 commits from master into master 2022-02-14 19:22:29 +01:00
7 changed files with 10 additions and 12 deletions

View file

@ -8,7 +8,7 @@
margin-right: .5em; margin-right: .5em;
margin-bottom: -.5em; margin-bottom: -.5em;
} }
.bid-icon-lbc { .bid-icon-lbc {
height: 1.2em; height: 1.2em;
margin-bottom: -.2em; margin-bottom: -.2em;

BIN
admin/images/speech-tab.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -108,7 +108,7 @@ class LBRYPress
$this->define('LBRY_VERSION', $this->version); $this->define('LBRY_VERSION', $this->version);
// Library Options Names // Library Options Names
$this->define('LBRY_SETTINGS_GROUP', 'lbry_settings_group'); //$this->define('LBRY_SETTINGS_GROUP', 'lbry_settings_group');
$this->define('LBRY_SETTINGS', 'lbry_settings'); $this->define('LBRY_SETTINGS', 'lbry_settings');
$this->define('LBRY_SETTINGS_SECTION_GENERAL', 'lbry_settings_section_general'); $this->define('LBRY_SETTINGS_SECTION_GENERAL', 'lbry_settings_section_general');
$this->define('LBRY_ADMIN_PAGE', 'lbrypress'); $this->define('LBRY_ADMIN_PAGE', 'lbrypress');

View file

@ -208,7 +208,7 @@ class LBRY_Admin
$license_array = LBRY()->licenses; $license_array = LBRY()->licenses;
if ( isset( $input[LBRY_LICENSE] ) && ( in_array( $input[LBRY_LICENSE], $license_array ) ) ) { if ( isset( $input[LBRY_LICENSE] ) && ( in_array( $input[LBRY_LICENSE], $license_array ) ) ) {
$new_input[LBRY_LICENSE] = sanitize_text_field( $input[LBRY_LICENSE] ); $new_input[LBRY_LICENSE] = sanitize_text_field( $input[LBRY_LICENSE] );
} }
if ( isset( $input[LBRY_LBC_PUBLISH] ) ) { if ( isset( $input[LBRY_LBC_PUBLISH] ) ) {
$new_input[LBRY_LBC_PUBLISH] = number_format( floatval( $input[LBRY_LBC_PUBLISH] ), 3, '.', '' ); $new_input[LBRY_LBC_PUBLISH] = number_format( floatval( $input[LBRY_LBC_PUBLISH] ), 3, '.', '' );
} }
@ -290,7 +290,6 @@ class LBRY_Admin
); );
} }
/** /**
* Checkbox to default to always allow publish on LBRY * Checkbox to default to always allow publish on LBRY
*/ */
@ -305,7 +304,6 @@ class LBRY_Admin
'<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>', '<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_default_publish_setting',
LBRY_SETTINGS, LBRY_SETTINGS,
); );
} }
@ -365,7 +363,6 @@ class LBRY_Admin
$options $options
); );
} }
/** /**
* Prints LBC per publish input * Prints LBC per publish input
@ -424,9 +421,9 @@ class LBRY_Admin
'<input type="password" id="' . esc_attr('%1$s') . '" name="' . esc_attr('%2$s[%1$s]') . '" placeholder="Leave empty for same password">', '<input type="password" id="' . esc_attr('%1$s') . '" name="' . esc_attr('%2$s[%1$s]') . '" placeholder="Leave empty for same password">',
LBRY_SPEECH_PW, LBRY_SPEECH_PW,
LBRY_SPEECH_SETTINGS, LBRY_SPEECH_SETTINGS,
); );
} }
/** /**
* Handles new channel form submission * Handles new channel form submission
*/ */

View file

@ -33,8 +33,7 @@ class LBRY_Daemon
* https://lbry.tech/api/sdk#address_unused * https://lbry.tech/api/sdk#address_unused
* @return string Unused wallet address in base58 * @return string Unused wallet address in base58
*/ */
public function wallet_unused_address() public function wallet_unused_address() {
{
try { try {
$result = $this->request( 'address_unused' ); $result = $this->request( 'address_unused' );
return $result->result; return $result->result;
@ -122,12 +121,12 @@ class LBRY_Daemon
if ( strpos( $channel_name, '@' ) ) { if ( strpos( $channel_name, '@' ) ) {
throw new \Exception( 'Illegal character "@" in channel name', 1 ); throw new \Exception( 'Illegal character "@" in channel name', 1 );
} }
// No white space allowed // No white space allowed
if ( strpos( $channel_name, ' ' ) ) { if ( strpos( $channel_name, ' ' ) ) {
throw new \Exception( "No spaces allowed in channel name", 1 ); throw new \Exception( "No spaces allowed in channel name", 1 );
} }
$channel_name = '@' . $channel_name; $channel_name = '@' . $channel_name;
try { try {

View file

@ -39,6 +39,7 @@ class LBRY_Network
// Save the post meta on 'save_post' hook // Save the post meta on 'save_post' hook
add_action( 'wp_insert_post', array( $this, 'save_post_meta' ), 11, 2 ); add_action( 'wp_insert_post', array( $this, 'save_post_meta' ), 11, 2 );
// Checkbox inside the WordPres meta box near "Publish" button // Checkbox inside the WordPres meta box near "Publish" button
add_action( 'post_submitbox_misc_actions', array( $this, 'publish_to_lbry_checkbox' ) ); add_action( 'post_submitbox_misc_actions', array( $this, 'publish_to_lbry_checkbox' ) );
} }

View file

@ -4,6 +4,7 @@
* *
* @package LBRYPress * @package LBRYPress
*/ */
defined('ABSPATH') || die(); // Exit if accessed directly
// if uninstall.php is not called by WordPress, die // if uninstall.php is not called by WordPress, die
defined('WP_UNINSTALL_PLUGIN') || die(); defined('WP_UNINSTALL_PLUGIN') || die();