'',
)
);
\add_settings_field(
'activitypub_profile_url',
\esc_html__( 'Profile URL', 'activitypub' ),
array( self::class, 'profile_url_callback' ),
'activitypub_user_settings',
'activitypub_user_profile'
);
\add_settings_field(
'activitypub_description',
\esc_html__( 'Biography', 'activitypub' ),
array( self::class, 'description_callback' ),
'activitypub_user_settings',
'activitypub_user_profile',
array( 'label_for' => 'activitypub_description' )
);
\add_settings_field(
'activitypub_header_image',
\esc_html__( 'Header Image', 'activitypub' ),
array( self::class, 'header_image_callback' ),
'activitypub_user_settings',
'activitypub_user_profile',
array( 'label_for' => 'activitypub_header_image' )
);
\add_settings_field(
'activitypub_notifications',
\esc_html__( 'Email Notifications', 'activitypub' ),
array( self::class, 'notifications_callback' ),
'activitypub_user_settings',
'activitypub_user_profile'
);
\add_settings_field(
'activitypub_extra_fields',
\esc_html__( 'Extra Fields', 'activitypub' ),
array( self::class, 'extra_fields_callback' ),
'activitypub_user_settings',
'activitypub_user_profile'
);
\add_settings_field(
'activitypub_also_known_as',
\esc_html__( 'Account Aliases', 'activitypub' ),
array( self::class, 'also_known_as_callback' ),
'activitypub_user_settings',
'activitypub_user_profile',
array( 'label_for' => 'activitypub_also_known_as' )
);
\add_settings_field(
'activitypub_hide_social_graph',
\__( 'Followers and Followings', 'activitypub' ),
array( self::class, 'hide_followers_callback' ),
'activitypub_user_settings',
'activitypub_user_profile'
);
// Add moderation section.
\add_settings_section(
'activitypub_user_moderation',
\esc_html__( 'Moderation', 'activitypub' ),
array( self::class, 'moderation_section_description' ),
'activitypub_user_settings',
array(
'before_section' => '',
)
);
\add_settings_field(
'activitypub_user_blocked_domains',
\esc_html__( 'Blocked Domains', 'activitypub' ),
array( self::class, 'blocked_domains_callback' ),
'activitypub_user_settings',
'activitypub_user_moderation'
);
\add_settings_field(
'activitypub_user_blocked_keywords',
\esc_html__( 'Blocked Keywords', 'activitypub' ),
array( self::class, 'blocked_keywords_callback' ),
'activitypub_user_settings',
'activitypub_user_moderation'
);
}
/**
* Section description callback.
*/
public static function section_description() {
echo '
' . \esc_html__( 'Define what others can see on your public Fediverse profile and next to your posts. With a profile picture and a fully completed profile, you are more likely to gain interactions and followers.', 'activitypub' ) . '
';
echo '' . \esc_html__( 'The ActivityPub plugin tries to take as much information as possible from your profile settings. However, the following settings are not supported by WordPress or should be adjusted independently of the WordPress settings.', 'activitypub' ) . '
';
}
/**
* Profile URL field callback.
*/
public static function profile_url_callback() {
$user = Actors::get_by_id( \get_current_user_id() );
?>
' . \esc_html( $user->get_webfinger() ) . '',
'' . \esc_url( $user->get_url() ) . ''
);
?>
get_webfinger() )
);
?>
data-state="">
/>
/>
/>
/>
/>
/>
@username@example.com are accepted and will be automatically normalized to the correct format.', 'activitypub' ) ); ?>
' . \esc_html__( 'Configure personal blocks to filter ActivityPub content you don\'t want to see.', 'activitypub' ) . '';
}
/**
* Blocked domains field callback.
*/
public static function blocked_domains_callback() {
$user_id = \get_current_user_id();
$blocked_domains = Moderation::get_user_blocks( $user_id )['domains'];
?>
>
get_redirect_uris();
$redirect_uri = ! empty( $redirect_uris ) ? $redirect_uris[0] : '—';
$post = \get_post( $client->get_post_id() );
$created = $post ? \date_i18n( \get_option( 'date_format' ), \strtotime( $post->post_date ) ) : '—';
?>
get_name() ); ?>
%2$s',
/* translators: %s: the application name */
\esc_attr( \sprintf( \__( 'Delete "%s"', 'activitypub' ), $client->get_name() ) ),
\esc_html__( 'Delete', 'activitypub' )
);
?>
get_name() : $client_id;
$scopes = isset( $token['scopes'] ) ? Scope::to_string( $token['scopes'] ) : '';
$created = ! empty( $token['created_at'] ) ? \date_i18n( \get_option( 'date_format' ), $token['created_at'] ) : '—';
$last_used = ! empty( $token['last_used_at'] ) ? \date_i18n( \get_option( 'date_format' ), $token['last_used_at'] ) : '—';
$meta_key = $token['meta_key'] ?? ''; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Not a DB query, just array key.
?>
%2$s',
/* translators: %s: the application name */
\esc_attr( \sprintf( \__( 'Revoke "%s"', 'activitypub' ), $client_name ) ),
\esc_html__( 'Revoke', 'activitypub' )
);
?>
/>