wphooks.info - enable_post_by_email_configuration

enable_post_by_email_configuration

The hook occurs in the following 4 files

/wp-mail.php:
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * a WordPress post. Mailbox connection information must be
 * configured under Settings > Writing
 *
 * @package WordPress
 */

/** Make sure that the WordPress bootstrap has run before continuing. */
require(dirname(__FILE__) . '/wp-load.php');

/** This filter is documented in wp-admin/options.php */
if ( ! apply_filters( 'enable_post_by_email_configuration', true ) )
	wp_die( __( 'This action has been disabled by the administrator.' ), 403 );

$mailserver_url = get_option( 'mailserver_url' );

if ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) {
	wp_die( __( 'This action has been disabled by the administrator.' ), 403 );
}

/**
wp-admin/options-writing.php:
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$parent_file = 'options-general.php';

get_current_screen()->add_help_tab( array(
	'id'      => 'overview',
	'title'   => __('Overview'),
	'content' => '<p>' . __('You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.') . '</p>' .
		'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );

/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
	get_current_screen()->add_help_tab( array(
		'id'      => 'options-postemail',
		'title'   => __( 'Post Via Email' ),
		'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress install an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret.' ) . '</p>',
	) );
}

/** This filter is documented in wp-admin/options-writing.php */
if ( apply_filters( 'enable_update_services_configuration', true ) ) {
wp-admin/options-writing.php:
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php endif; ?>

<?php
do_settings_fields('writing', 'default');
do_settings_fields('writing', 'remote_publishing'); // A deprecated section.
?>
</table>

<?php
/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
?>
<h2 class="title"><?php _e( 'Post via email' ) ?></h2>
<p><?php
printf(
	/* translators: 1, 2, 3: examples of random email addresses */
	__( 'To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
	sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
	sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
	sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
wp-admin/options.php:
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
} else {
	$whitelist_options['general'][] = 'new_admin_email';

	/**
	 * Filters whether the post-by-email functionality is enabled.
	 *
	 * @since 3.0.0
	 *
	 * @param bool $enabled Whether post-by-email configuration is enabled. Default true.
	 */
	if ( apply_filters( 'enable_post_by_email_configuration', true ) )
		$whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
}

/**
 * Filters the options white list.
 *
 * @since 2.7.0
 *
 * @param array $whitelist_options White list options.