Changeset 13111
- Timestamp:
- 09/19/2021 01:02:18 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
-
bp-core/bp-core-blocks.php (modified) (4 diffs)
-
bp-core/classes/class-bp-core.php (modified) (1 diff)
-
bp-core/css/blocks/login-form-rtl.css (modified) (1 diff)
-
bp-core/css/blocks/login-form.css (modified) (1 diff)
-
bp-core/js/blocks/login-form.js (modified) (4 diffs)
-
bp-core/sass/blocks/login-form.scss (modified) (1 diff)
-
js/bp-core/js/blocks/login-form.js (modified) (1 diff)
-
js/bp-core/js/blocks/login-form/edit.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-blocks.php
r13108 r13111 222 222 */ 223 223 function bp_blocks_get_login_widget_registration_link( $content = '', $args = array() ) { 224 if ( isset( $args['form_id'] ) && 'bp-login-widget-form' === $args['form_id'] && bp_get_signup_allowed() ) { 225 $content .= sprintf( 226 '<p class="bp-login-widget-register-link"><a href="%1$s">%2$s</a></p>', 227 esc_url( bp_get_signup_page() ), 228 esc_html__( 'Register', 'buddypress' ) 229 ); 224 if ( isset( $args['form_id'] ) && 'bp-login-widget-form' === $args['form_id'] ) { 225 if ( bp_get_signup_allowed() ) { 226 $content .= sprintf( 227 '<p class="bp-login-widget-register-link"><a href="%1$s">%2$s</a></p>', 228 esc_url( bp_get_signup_page() ), 229 esc_html__( 'Register', 'buddypress' ) 230 ); 231 } 232 233 if ( isset( $args['include_pwd_link'] ) && true === $args['include_pwd_link'] ) { 234 $content .= sprintf( 235 '<p class="bp-login-widget-pwd-link"><a href="%1$s">%2$s</a></p>', 236 esc_url( wp_lostpassword_url( bp_get_root_domain() ) ), 237 esc_html__( 'Lost your password?', 'buddypress' ) 238 ); 239 } 230 240 } 231 241 … … 261 271 $attributes, 262 272 array( 263 'title' => '', 273 'title' => '', 274 'forgotPwdLink' => false, 264 275 ) 265 276 ); … … 339 350 } else { 340 351 $action_output = ''; 352 $pwd_link = (bool) $block_args['forgotPwdLink']; 353 341 354 if ( has_action( 'bp_before_login_widget_loggedout' ) ) { 342 355 ob_start(); … … 358 371 $widget_content .= wp_login_form( 359 372 array( 360 'echo' => false, 361 'form_id' => 'bp-login-widget-form', 362 'id_username' => 'bp-login-widget-user-login', 363 'label_username' => __( 'Username', 'buddypress' ), 364 'id_password' => 'bp-login-widget-user-pass', 365 'label_password' => __( 'Password', 'buddypress' ), 366 'id_remember' => 'bp-login-widget-rememberme', 367 'id_submit' => 'bp-login-widget-submit', 373 'echo' => false, 374 'form_id' => 'bp-login-widget-form', 375 'id_username' => 'bp-login-widget-user-login', 376 'label_username' => __( 'Username', 'buddypress' ), 377 'id_password' => 'bp-login-widget-user-pass', 378 'label_password' => __( 'Password', 'buddypress' ), 379 'id_remember' => 'bp-login-widget-rememberme', 380 'id_submit' => 'bp-login-widget-submit', 381 'include_pwd_link' => $pwd_link, 368 382 ) 369 383 ); -
trunk/src/bp-core/classes/class-bp-core.php
r13006 r13111 398 398 'style_url' => plugins_url( 'css/blocks/login-form.css', dirname( __FILE__ ) ), 399 399 'attributes' => array( 400 'title' => array(400 'title' => array( 401 401 'type' => 'string', 402 402 'default' => '', 403 ), 404 'forgotPwdLink' => array( 405 'type' => 'boolean', 406 'default' => false, 403 407 ), 404 408 ), -
trunk/src/bp-core/css/blocks/login-form-rtl.css
r12999 r13111 35 35 vertical-align: super; 36 36 } 37 38 #bp-login-widget-form .bp-login-widget-pwd-link { 39 font-size: 80%; 40 } -
trunk/src/bp-core/css/blocks/login-form.css
r12999 r13111 35 35 vertical-align: super; 36 36 } 37 38 #bp-login-widget-form .bp-login-widget-pwd-link { 39 font-size: 80%; 40 } -
trunk/src/bp-core/js/blocks/login-form.js
r12999 r13111 135 135 PanelBody = _wp$components.PanelBody, 136 136 TextControl = _wp$components.TextControl, 137 ToggleControl = _wp$components.ToggleControl, 137 138 _wp$element = _wp.element, 138 139 Fragment = _wp$element.Fragment, … … 149 150 var attributes = _ref.attributes, 150 151 setAttributes = _ref.setAttributes; 151 var title = attributes.title; 152 var title = attributes.title, 153 forgotPwdLink = attributes.forgotPwdLink; 152 154 return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, { 153 155 title: __('Settings', 'buddypress'), … … 159 161 setAttributes({ 160 162 title: text 163 }); 164 } 165 }), createElement(ToggleControl, { 166 label: __('Include the link to reset the user password', 'buddypress'), 167 checked: !!forgotPwdLink, 168 onChange: function onChange() { 169 setAttributes({ 170 forgotPwdLink: !forgotPwdLink 161 171 }); 162 172 } … … 244 254 type: 'string', 245 255 default: '' 256 }, 257 forgotPwdLink: { 258 type: 'boolean', 259 default: false 246 260 } 247 261 }, -
trunk/src/bp-core/sass/blocks/login-form.scss
r12999 r13111 41 41 vertical-align: super; 42 42 } 43 44 .bp-login-widget-pwd-link { 45 font-size: 80%; 46 } 43 47 } -
trunk/src/js/bp-core/js/blocks/login-form.js
r12999 r13111 31 31 default: '', 32 32 }, 33 forgotPwdLink: { 34 type: 'boolean', 35 default: false, 36 }, 33 37 }, 34 38 edit: editLoginForm, -
trunk/src/js/bp-core/js/blocks/login-form/edit.js
r12999 r13111 10 10 PanelBody, 11 11 TextControl, 12 ToggleControl, 12 13 }, 13 14 element: { … … 30 31 31 32 const editLoginForm = ( { attributes, setAttributes } ) => { 32 const { title } = attributes;33 const { title,forgotPwdLink } = attributes; 33 34 34 35 return ( … … 43 44 } } 44 45 /> 46 <ToggleControl 47 label={ __( 'Include the link to reset the user password', 'buddypress' ) } 48 checked={ !! forgotPwdLink } 49 onChange={ () => { 50 setAttributes( { forgotPwdLink: ! forgotPwdLink } ); 51 } } 52 /> 45 53 </PanelBody> 46 54 </InspectorControls>
Note: See TracChangeset
for help on using the changeset viewer.