2023-01-21 01:31:34 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// ACCOUNT MODERATION MESSAGE SECTION
|
|
|
|
// =============================================================================
|
|
|
|
|
2023-08-08 22:45:55 +02:00
|
|
|
/**
|
|
|
|
* Outputs the HTML for the account moderation message section
|
|
|
|
*
|
|
|
|
* @since Fictioneer 5.0
|
|
|
|
*
|
|
|
|
* @param WP_User $args['user'] Current user.
|
|
|
|
* @param boolean $args['is_admin'] True if the user is an administrator.
|
|
|
|
* @param boolean $args['is_author'] True if the user is an author (by capabilities).
|
|
|
|
* @param boolean $args['is_editor'] True if the user is an editor.
|
|
|
|
* @param boolean $args['is_moderator'] True if the user is a moderator (by capabilities).
|
|
|
|
*/
|
|
|
|
|
|
|
|
function fictioneer_account_moderation_message( $args ) {
|
|
|
|
// Setup
|
|
|
|
$message = get_the_author_meta( 'fictioneer_admin_moderation_message', $args['user']->ID );
|
|
|
|
|
|
|
|
// Abort conditions
|
|
|
|
if ( empty( $message ) ) return;
|
|
|
|
|
|
|
|
// Start HTML ---> ?>
|
|
|
|
<div class="profile__moderation-message profile__segment">
|
|
|
|
<div class="infobox polygon">
|
|
|
|
<p><?php echo $message; ?></p>
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
2023-08-08 22:45:55 +02:00
|
|
|
</div>
|
|
|
|
<?php // <--- End HTML
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
add_action( 'fictioneer_account_content', 'fictioneer_account_moderation_message', 5 );
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// ACCOUNT PROFILE SECTION
|
|
|
|
// =============================================================================
|
|
|
|
|
2023-08-08 22:45:55 +02:00
|
|
|
/**
|
|
|
|
* Outputs the HTML for the account profile section
|
|
|
|
*
|
|
|
|
* @since Fictioneer 5.0
|
|
|
|
*
|
|
|
|
* @param WP_User $args['user'] Current user.
|
|
|
|
* @param boolean $args['is_admin'] True if the user is an administrator.
|
|
|
|
* @param boolean $args['is_author'] True if the user is an author (by capabilities).
|
|
|
|
* @param boolean $args['is_editor'] True if the user is an editor.
|
|
|
|
* @param boolean $args['is_moderator'] True if the user is a moderator (by capabilities).
|
|
|
|
*/
|
|
|
|
|
|
|
|
function fictioneer_account_profile( $args ) {
|
|
|
|
get_template_part( 'partials/account/_profile', null, $args );
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
add_action( 'fictioneer_account_content', 'fictioneer_account_profile', 10 );
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// ACCOUNT OAUTH BINDINGS SECTION
|
|
|
|
// =============================================================================
|
|
|
|
|
2023-08-08 22:45:55 +02:00
|
|
|
/**
|
|
|
|
* Outputs the HTML for the OAuth section
|
|
|
|
*
|
|
|
|
* @since Fictioneer 5.0
|
|
|
|
*
|
|
|
|
* @param WP_User $args['user'] Current user.
|
|
|
|
* @param boolean $args['is_admin'] True if the user is an administrator.
|
|
|
|
* @param boolean $args['is_author'] True if the user is an author (by capabilities).
|
|
|
|
* @param boolean $args['is_editor'] True if the user is an editor.
|
|
|
|
* @param boolean $args['is_moderator'] True if the user is a moderator (by capabilities).
|
|
|
|
*/
|
|
|
|
|
|
|
|
function fictioneer_account_oauth( $args ) {
|
|
|
|
get_template_part( 'partials/account/_oauth', null, $args );
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
add_action( 'fictioneer_account_content', 'fictioneer_account_oauth', 20 );
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// ACCOUNT DATA SECTION
|
|
|
|
// =============================================================================
|
|
|
|
|
2023-08-08 22:45:55 +02:00
|
|
|
/**
|
|
|
|
* Outputs the HTML for the data section
|
|
|
|
*
|
|
|
|
* @since Fictioneer 5.0
|
|
|
|
*
|
|
|
|
* @param WP_User $args['user'] Current user.
|
|
|
|
* @param boolean $args['is_admin'] True if the user is an administrator.
|
|
|
|
* @param boolean $args['is_author'] True if the user is an author (by capabilities).
|
|
|
|
* @param boolean $args['is_editor'] True if the user is an editor.
|
|
|
|
* @param boolean $args['is_moderator'] True if the user is a moderator (by capabilities).
|
|
|
|
*/
|
|
|
|
|
|
|
|
function fictioneer_account_data( $args ) {
|
|
|
|
get_template_part( 'partials/account/_data', null, $args );
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
add_action( 'fictioneer_account_content', 'fictioneer_account_data', 30 );
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// ACCOUNT DISCUSSION SECTION
|
|
|
|
// =============================================================================
|
|
|
|
|
2023-08-08 22:45:55 +02:00
|
|
|
/**
|
|
|
|
* Outputs the HTML for the discussions section
|
|
|
|
*
|
|
|
|
* @since Fictioneer 5.0
|
|
|
|
*
|
|
|
|
* @param WP_User $args['user'] Current user.
|
|
|
|
* @param boolean $args['is_admin'] True if the user is an administrator.
|
|
|
|
* @param boolean $args['is_author'] True if the user is an author (by capabilities).
|
|
|
|
* @param boolean $args['is_editor'] True if the user is an editor.
|
|
|
|
* @param boolean $args['is_moderator'] True if the user is a moderator (by capabilities).
|
|
|
|
*/
|
|
|
|
|
|
|
|
function fictioneer_account_discussions( $args ) {
|
|
|
|
get_template_part( 'partials/account/_discussions', null, $args );
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
add_action( 'fictioneer_account_content', 'fictioneer_account_discussions', 40 );
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
// ACCOUNT DANGER ZONE SECTION
|
|
|
|
// =============================================================================
|
|
|
|
|
2023-08-08 22:45:55 +02:00
|
|
|
/**
|
|
|
|
* Outputs the HTML for the danger zone section
|
|
|
|
*
|
|
|
|
* @since Fictioneer 5.0
|
|
|
|
*
|
|
|
|
* @param WP_User $args['user'] Current user.
|
|
|
|
* @param boolean $args['is_admin'] True if the user is an administrator.
|
|
|
|
* @param boolean $args['is_author'] True if the user is an author (by capabilities).
|
|
|
|
* @param boolean $args['is_editor'] True if the user is an editor.
|
|
|
|
* @param boolean $args['is_moderator'] True if the user is a moderator (by capabilities).
|
|
|
|
*/
|
|
|
|
|
|
|
|
function fictioneer_account_danger_zone( $args ) {
|
|
|
|
get_template_part( 'partials/account/_danger-zone', null, $args );
|
2023-01-21 01:31:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( get_option( 'fictioneer_enable_subscriber_self_delete' ) ) {
|
|
|
|
add_action( 'fictioneer_account_content', 'fictioneer_account_danger_zone', 100 );
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|